Serveur MCP

Kleap

io.github.kleaphq/kleap

Ce que fait ce MCP

Builds, edits, publishes, hosts, connects domains, and provides analytics and search performance data for websites and web apps.

buy_domain
Buy Domain
Start buying a domain: returns a Stripe checkout_url (valid 30 min) that the USER must open and pay. Nothing is bought until they complete checkout — give them the link, never say it is purchased. With app_id it is connected to that app after payment.
Accès externe
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['domain', 'context'], 'properties': {'years': {'type': 'number', 'description': '1-10, default 1'}, 'app_id': {'type': 'number', 'description': 'App to connect it to'}, 'domain': {'type': 'string', 'description': "e.g. 'mybakery.com'"}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}, 'registrant': {'type': 'object', 'required': ['first_name', 'last_name', 'email', 'phone', 'address', 'city', 'country'], 'properties': {'city': {'type': 'string'}, 'email': {'type': 'string'}, 'phone': {'type': 'string', 'description': 'International format, e.g. +33 6 12 34 56 78'}, 'state': {'type': 'string'}, 'address': {'type': 'string'}, 'country': {'type': 'string', 'description': 'ISO 3166-1 alpha-2, e.g. FR'}, 'address2': {'type': 'string'}, 'last_name': {'type': 'string'}, 'first_name': {'type': 'string'}, 'postal_code': {'type': 'string', 'description': 'Required except in countries without postal codes'}, 'organization': {'type': 'string'}}, 'description': "The domain OWNER (legal registrant) — can differ from the person paying. Ask the user for it; if omitted, the payer's billing details are used.", 'additionalProperties': False}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'price': {}, 'years': {}, 'domain': {}, 'currency': {}, 'expires_at': {}, 'checkout_url': {}}, 'additionalProperties': False}
check_domain
Check Domain
Check a domain's connection / DNS status for a Kleap app.
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['domain', 'context'], 'properties': {'domain': {'type': 'string', 'description': "The domain, e.g. 'mybakery.com'"}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'tls': {}, 'url': {}, 'checks': {}, 'domain': {}, 'status': {}, 'message': {}}, 'additionalProperties': False}
check_task
Check Build Status
Check a create/modify task. Returns quickly with the CURRENT status — report it to the user rather than calling again in the same turn; a build takes 5-15 min, so the answer to 'is it ready?' is usually 'still building, here is the progress'. The optional `wait` can shorten the hold but cannot exceed the server cap (8 seconds by default). status is one of: queued, processing, completed, failed, unknown_task (the id is unknown or aged out — that is an answer, not a failure: check the site itself with get_publish_status). On 'completed' the FILES are written; check deployment_status — 'pending' means the site is going live right now and production_url is still the PREVIOUS version, so say 'built, going live' and check once more in about a minute rather than reporting it stuck. 'deployed' means it is genuinely live. On 'failed': TASK_TIMEOUT/STALE_TASK = transient stall → retry_task (returns a NEW task_id to poll); TASK_FAILED = read error.message, retry once. (Out-of-credits is not a task failure — create/modify reject up front with 402 INSUFFICIENT_CREDITS.)
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['task_id', 'context'], 'properties': {'wait': {'type': 'number', 'description': 'Optional. Seconds to hold the connection before returning. Capped server-side at a few seconds so the call always comes back inside a single turn — asking for more has no effect. Leave it unset.'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}, 'task_id': {'type': 'string', 'description': 'The task_id returned by create_app or modify_app'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'name': {}, 'plan': {}, 'slug': {}, 'app_id': {}, 'reason': {}, 'result': {}, 'status': {}, 'palette': {}, 'task_id': {'type': 'string'}, 'metadata': {}, 'progress': {}, 'preview_url': {}, 'production_url': {}, 'screenshot_url': {}, 'deployment_status': {}}, 'additionalProperties': False}
connect_domain
Connect Domain
Connect a domain the user ALREADY OWNS to a live Kleap app (routing + automatic TLS). The app must be live first — a create_app/modify_app with deployment_status deployed already counts as published, so you do NOT need publish_app first. The user points the domain's A record to Kleap. Does not buy anything.
Accès externe
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'domain', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app id (must be published)'}, 'domain': {'type': 'string', 'description': "The domain to connect, e.g. 'mybakery.com'"}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'app_id': {}, 'domain': {}, 'status': {}, 'warnings': {}, 'dns_config': {}, 'already_connected': {}}, 'additionalProperties': False}
connect_search_console
Connect Google Search Console
Use this when the user wants to connect (or reconnect) Google Search Console for a site — typically right after get_search_console reported connected:false. Returns a consent_url: give it to the user as a link and ask them to open it and approve access with the Google account that owns the domain in Search Console. That one approval MUST happen in a browser — Google does not allow it any other way, so never claim you can do it for them. Nothing else is needed afterwards: the Search Console property is bound to the site's custom domain automatically, and get_search_console starts answering. If requires_custom_domain is true the site has no custom domain yet: connecting Google would grant access to nothing, so connect a domain first (connect_domain) and publish. If it reports the site is already connected, do not send anyone through consent again — just read the numbers.
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app id to connect Search Console for'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'app_id': {'type': 'number'}, 'message': {}, 'site_url': {}, 'connected': {'type': 'boolean'}, 'consent_url': {}, 'google_email': {}, 'custom_domain': {}, 'site_selected': {'type': 'boolean'}, 'expires_in_minutes': {'type': 'number'}, 'requires_custom_domain': {'type': 'boolean'}}, 'additionalProperties': False}
create_app
Create Website
Use this when the user wants a complete, hosted website or web app built from a text description (e.g. 'build me a website for X'). Kleap's AI builds AND auto-deploys the whole site; this takes a few minutes (typically 5 to 15 min). Returns a build_url instantly so the user can watch it build live. In a widget client (ChatGPT Apps) the preview above shows real-time progress and reveals the final live URL by itself, so you do NOT need to block or keep polling check_task. Prefer this over write_files for full-site creation.
Accès externe
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['prompt', 'context'], 'properties': {'prompt': {'type': 'string', 'maxLength': 10000, 'minLength': 1, 'description': 'Detailed description of the website to build'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}, 'visibility': {'enum': ['public', 'personal'], 'type': 'string', 'default': 'personal', 'description': 'Controls discovery listing: public = discoverable, personal = unlisted. Both may be deployed to a publicly reachable URL; personal does not add access control.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'name': {'type': 'string'}, 'app_id': {}, 'status': {'type': 'string'}, 'task_id': {}, 'build_url': {'type': 'string'}}, 'additionalProperties': False}
delete_database_rows
Delete Database Rows
Delete the rows matching where (required, non-empty, exact matches, e.g. {"id":42}). Permanent. Returns how many were deleted.
Destructif
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'table', 'where', 'context'], 'properties': {'table': {'type': 'string', 'description': 'Table name (public schema)'}, 'where': {'type': 'object', 'description': 'Which rows (required)', 'additionalProperties': {}}, 'app_id': {'type': 'number', 'description': 'The app id'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'table': {}, 'deleted': {}}, 'additionalProperties': False}
delete_files
Delete Files
Remove pages, components or assets from a site — the counterpart to write_files. Use it when a page should no longer exist: a wrong route, a duplicate, an outdated landing page, an image nobody references. Do NOT overwrite the file with empty content instead: that leaves a URL answering 200 with nothing, which is worse for SEO than a clean 404. Deleting a binary also removes its stored bytes. Paths Kleap owns (astro.config.mjs, package.json, tsconfig.json…) are refused — the build lays its own copy back down, so removing them changes nothing. The homepage (src/pages/index.astro) is refused too: a site with no homepage is broken — write a new one instead, writing replaces it. Returns which paths were actually deleted and which did not exist. The pages STAY LIVE until you call publish_app.
Destructif
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'paths', 'context'], 'properties': {'paths': {'type': 'array', 'items': {'type': 'string'}, 'minItems': 1, 'description': 'Project-relative paths to delete, e.g. ["src/pages/old.astro", "public/images/unused.png"]'}, 'app_id': {'type': 'number', 'description': 'The app ID'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'app_id': {'type': 'number'}, 'deleted': {}, 'missing': {}}, 'additionalProperties': False}
edit_files
Edit Files In Place
Change PART of a file without resending it — the counterpart to write_files. Give `old_string` (exact text as in the file today) and `new_string`; Kleap reads, replaces, stores. Nothing else moves. Use it whenever the file exists and only a line, block or URL changes: resending a 30KB layout to fix one line wastes tokens and risks corrupting the rest. read_files first, copy the text EXACTLY. `old_string` must appear once — otherwise the error names the count; add context or pass replace_all:true. Edits are validated together: if any is invalid, nothing is written. Across files the writes are sequential — a late failure names what was already applied. new_string "" deletes the match. Not for new files or binaries. Then publish_app.
Destructif
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'edits', 'context'], 'properties': {'edits': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'old_string', 'new_string'], 'properties': {'path': {'type': 'string', 'description': 'Project-relative path of an EXISTING file'}, 'new_string': {'type': 'string', 'description': 'Replacement text. "" deletes the match.'}, 'old_string': {'type': 'string', 'minLength': 1, 'description': 'Exact text to find, copied from the file. Must appear once unless replace_all.'}, 'replace_all': {'type': 'boolean', 'description': 'Replace EVERY occurrence instead of requiring a unique match.'}}, 'additionalProperties': False}, 'minItems': 1, 'description': 'Edits, in order. Validated before any write.'}, 'app_id': {'type': 'number', 'description': 'The app ID'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'edits': {}, 'paths': {}, 'app_id': {'type': 'number'}, 'edited': {}}, 'additionalProperties': False}
find_app
Find Website by Address
Resolve a website the user refers to by its ADDRESS — a custom domain ('mysite.ch'), a kleap.io URL ('mysite.kleap.io'), or a slug — to its app_id. Use this FIRST whenever the user names a site by its address instead of an app_id (e.g. 'edit mysite.ch'), then pass the returned app_id to get_app / modify_app / publish_app. ADDRESS TO SHOW THE USER: site_url. When the owner has connected a domain, custom_domain is set and site_url is that domain — say THAT, never the {slug}.kleap.io host, which is the internal address they did not choose.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['query', 'context'], 'properties': {'query': {'type': 'string', 'description': "A domain, full URL, or slug — e.g. 'mysite.ch', 'https://mysite.ch', or 'mysite.kleap.io'"}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'name': {}, 'slug': {}, 'found': {'type': 'boolean'}, 'query': {'type': 'string'}, 'app_id': {}, 'reason': {}, 'status': {}, 'matched': {}, 'site_url': {}, 'custom_domain': {}, 'production_url': {}, 'screenshot_url': {}}, 'additionalProperties': False}
generate_image
Generate Image
Put a REAL photo or illustration on the site by describing it — no image bytes to send. Give a vivid `prompt` and a `public/` `path` (e.g. public/hero.jpg); Kleap generates it with Cloudflare FLUX.2 and stores it as a proper binary asset, exactly like write_files with encoding:"base64" but with NO base64 to transmit (a real image's base64 is too big for a model to emit reliably — this is the ONLY dependable way to add a generated picture). Use it for hero photos, section illustrations, onboarding images, OG images, or to replace a broken/ugly image. Square 768×768 by default; pass width/height (256–1440) for other ratios; hd:true uses the premium model (sharper, slower). ⚠️ To REPLACE an existing image, generate to a NEW filename (e.g. hero-2.jpg) and point the markup at it — overwriting the same path can be served stale from CDN/R2 cache. After it returns, call publish_app to deploy it live.
Destructif
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'path', 'prompt', 'context'], 'properties': {'hd': {'type': 'boolean', 'description': 'true = premium model (flux-2-dev): sharper, slower. Default = fast klein model.'}, 'path': {'type': 'string', 'description': 'public/ image path to create, ending .png/.jpg/.jpeg/.webp (e.g. public/hero.jpg). Use a NEW name to replace an image.'}, 'width': {'type': 'number', 'description': 'Pixel width 256–1440 (default 768).'}, 'app_id': {'type': 'number', 'description': 'The app ID'}, 'height': {'type': 'number', 'description': 'Pixel height 256–1440 (default 768).'}, 'prompt': {'type': 'string', 'description': 'Vivid description of the image to generate (subject, mood, lighting, style).'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'path': {}, 'size': {}, 'bytes': {}, 'model': {}}, 'additionalProperties': False}
get_analytics
Get Site Analytics
Use this when the user asks about traffic, visitors, or which pages/referrers are performing on their PUBLISHED site. Backed by the same analytics as the Kleap dashboard's Visitors view. Returns zeroed data with configured:false if the app has never been published (analytics is set up automatically on publish). Requires the analytics:read scope — sessions connected BEFORE this tool shipped don't have it: on a 403 INSUFFICIENT_SCOPE error, tell the user to disconnect and reconnect the Kleap integration (re-authorize) to grant the scope.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app id to fetch analytics for'}, 'period': {'enum': ['7d', '30d', '90d'], 'type': 'string', 'description': "Time window: '7d' (default), '30d', or '90d'"}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'app_id': {'type': 'number'}, 'period': {}, 'visitors': {'type': 'number'}, 'pageviews': {'type': 'number'}, 'referrers': {}, 'top_pages': {}, 'configured': {'type': 'boolean'}}, 'additionalProperties': False}
get_app
Get Website Details
Show a website to the user: its screenshot, name and live address. This is the ONE tool that renders the finished-site card, so call it once after a build or edit has finished and deployed (check_task says deployment_status deployed) — that is what lets the user SEE what was built. Also use it for plain details: name, slug, URLs, creation date, status. ADDRESS TO SHOW: site_url. If custom_domain is set, the owner connected that domain and it IS their site's address — never hand them the {slug}.kleap.io host instead, they did not choose it. Never call this while a build is still running: it would show the previous version as if it were the new one.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app ID'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'name': {}, 'slug': {}, 'app_id': {}, 'status': {}, 'site_url': {}, 'created_at': {}, 'preview_url': {}, 'custom_domain': {}, 'custom_domains': {}, 'production_url': {}, 'screenshot_url': {}}, 'additionalProperties': False}
get_credits
Check Credits
Use this when the user asks about their remaining credit balance or plan status.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['context'], 'properties': {'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'credits': {}, 'is_paid': {}}, 'additionalProperties': False}
get_database_schema
Get Database Schema
The app's Kleap Database (Postgres): its tables, row counts and columns. Call it before reading or writing rows. provisioned:false means the app has no database yet — create one with modify_app (describe the data to store).
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app id'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'app_id': {}, 'tables': {}, 'provisioned': {}}, 'additionalProperties': False}
get_form_submissions
Get Form Submissions
Use this when the user asks who filled out their contact form, or wants to see/export leads from their live site. Returns submissions from any <form> built with KleapForm on the app, newest first. Empty list is normal for a brand new site with no visitors yet. Requires the forms:read scope (submissions contain visitor PII) — sessions connected BEFORE this tool shipped don't have it: on a 403 INSUFFICIENT_SCOPE error, tell the user to disconnect and reconnect the Kleap integration (re-authorize) to grant the scope.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'limit': {'type': 'number', 'description': 'Max rows to return (default 20, max 100)'}, 'since': {'type': 'string', 'description': "Only return submissions at/after this ISO 8601 date, e.g. '2026-06-01T00:00:00Z'"}, 'app_id': {'type': 'number', 'description': 'The app id to fetch submissions for'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'count': {'type': 'number'}, 'app_id': {'type': 'number'}, 'submissions': {}}, 'additionalProperties': False}
get_publish_status
Check Publish Status
Use this to check whether a website is actually published and live. Returns the published state, the live production URL, and — once a publish has run — the PUBLISH REPORT of what Kleap checked on the site it just built: broken_links (existing pages that fail), dead_nav_links (menu entries pointing at a page that was never written — 90% of real dead links, /contact most often), incoherent_pages (a page answering 200 with content that contradicts the link leading to it), checks (source findings that did NOT block the publish, each with a category and a plain sentence: forms that submit into the void, islands with no client directive so buttons do nothing, broken images, hand-rolled auth or unguarded database access, dead API routes), design_gate (was the rendered homepage looked at), live_verified (was the NEW version confirmed serving), and SEO coverage (JSON-LD pages, sitemap URL count, robots, llms.txt). report.checked:true means the audit RAN, so empty lists mean nothing was found, not that nothing was looked at. If finding_count is above zero, tell the user what was found — in the report's own words, not the rule slugs — and offer to fix it. Do NOT describe a publish as clean when the report lists findings: a site can be live, pretty and still take no leads. status is one of: published, deploying, not_published, unknown_app. Returns the state at THIS instant — report it and end the turn; publishing takes minutes, so calling it repeatedly in one turn only burns the turn.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app ID to check'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'name': {}, 'slug': {}, 'app_id': {'type': 'number'}, 'reason': {}, 'report': {}, 'status': {}, 'production_url': {}, 'screenshot_url': {}}, 'additionalProperties': False}
get_screenshot
Screenshot Website
Use this when the user wants to see a visual screenshot of their website. Rate-limited to 1/min per app. The returned image_url is a PNG on the asset host — render it as an image (![preview](image_url)) and nothing else. It is NOT the website's address, so never present it to the user as their site link, and never open, fetch or web-search it: the site's own address is production_url from get_app / find_app.
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app ID'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'name': {}, 'slug': {}, 'width': {}, 'app_id': {'type': 'number'}, 'height': {}, 'status': {'type': 'string'}, 'image_url': {}, 'preview_url': {}, 'production_url': {}, 'screenshot_url': {}}, 'additionalProperties': False}
get_search_console
Get Google Search Performance
Use this when the user asks how their site is doing IN GOOGLE SEARCH — keywords/queries they rank for, impressions, clicks from search, CTR, or average position. Backed by their own Google Search Console property (connected per site in Kleap's options), so it is the real Google data, not an estimate. Returns totals plus the top queries and top pages that produced them. Search Console lags real traffic by ~2 days — the newest days are always incomplete, say so rather than reporting a drop. If connected is false or site_selected is false, the site simply has no Search Console hooked up: call connect_search_console(app_id) — it returns a consent_url to hand the user, and that is the whole setup. Do NOT send them hunting through Kleap's settings for it. For visitors and pageviews on the site itself (all sources, not just Google), use get_analytics instead. Requires the analytics:read scope — on a 403 INSUFFICIENT_SCOPE error, tell the user to disconnect and reconnect the Kleap integration (re-authorize).
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app id to fetch search data for'}, 'period': {'enum': ['7d', '28d', '30d', '90d'], 'type': 'string', 'description': "Time window: '28d' (default, the window Search Console itself shows), '7d', '30d' or '90d'"}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'ctr': {'type': 'number'}, 'note': {}, 'app_id': {'type': 'number'}, 'clicks': {'type': 'number'}, 'period': {}, 'message': {}, 'has_data': {'type': 'boolean'}, 'position': {'type': 'number'}, 'site_url': {}, 'connected': {'type': 'boolean'}, 'top_pages': {}, 'impressions': {'type': 'number'}, 'top_queries': {}, 'site_selected': {'type': 'boolean'}}, 'additionalProperties': False}
insert_database_rows
Insert Database Rows
Insert up to 500 rows into one table of the app's database. Returns the inserted rows (with generated ids/defaults).
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'table', 'rows', 'context'], 'properties': {'rows': {'type': 'array', 'items': {'type': 'object', 'additionalProperties': {}}, 'description': 'Rows: column → value'}, 'table': {'type': 'string', 'description': 'Table name (public schema)'}, 'app_id': {'type': 'number', 'description': 'The app id'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'rows': {}, 'table': {}, 'inserted': {}}, 'additionalProperties': False}
list_app_files
List App Files
List the source file PATHS of an app (names only, no contents). See the project structure, then read_files to get contents before editing. Astro: src/pages/*.astro, src/data/*.json, src/components/*.astro, public/*.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app ID'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'count': {}, 'files': {}, 'app_id': {'type': 'number'}}, 'additionalProperties': False}
list_apps
List My Websites
Use this when the user wants to see all their websites with name, slug, preview URL, and production URL.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['context'], 'properties': {'limit': {'type': 'number', 'default': 20, 'description': 'Number of apps to return (max 100)'}, 'offset': {'type': 'number', 'default': 0, 'description': 'Pagination offset'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'apps': {}, 'total': {}}, 'additionalProperties': False}
modify_app
Modify Website
Use this when the user wants to change or update an existing website. The AI can overwrite or remove existing content and automatically publishes the result to the live site. This consumes Kleap credits. Needs the app_id — if the user named the site by its address (e.g. 'mysite.ch'), call find_app first to get the app_id.
Destructif Accès externe
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'message', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app ID to modify'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}, 'message': {'type': 'string', 'maxLength': 10000, 'minLength': 1, 'description': "What to change (e.g. 'Change colors to blue, add a contact form')"}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'name': {}, 'plan': {}, 'slug': {}, 'app_id': {'type': 'number'}, 'status': {'type': 'string'}, 'palette': {}, 'task_id': {}, 'message_id': {}, 'preview_url': {}, 'production_url': {}, 'screenshot_url': {}, 'deployment_status': {}}, 'additionalProperties': False}
publish_app
Publish Website
Use this to take a website LIVE at its public URL. Publishing is VERIFIED-LIVE: the app is only reported published once the new version is provably serving — otherwise it reports 'not confirmed live', never a false 'it is online'. Publishing also AUDITS the built site: every internal link on every page (menu entries to a page never written are the #1 case), pages whose content contradicts the link leading to them, and JSON-LD/sitemap/robots coverage. Most deploys land in under a minute, so this call WAITS a bounded time and returns that `report` here when it does — read it before calling the launch a success, and if it lists findings, FIX THEM (write the missing page, or remove the dead link) before you answer, as you would a build error. On a slower deploy it returns 'publishing' with no report; then do not poll get_publish_status in a loop inside one turn — check once when the user asks again.
Destructif Accès externe
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app ID to publish'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'app_id': {'type': 'number'}, 'report': {}, 'status': {}, 'poll_url': {}, 'deploy_key': {}, 'production_url': {}}, 'additionalProperties': False}
query_database_rows
Query Database Rows
Read rows from one table of the app's database. where = exact matches, e.g. {"status":"new"}. Max 500 rows per call; page with offset while has_more is true.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'table', 'context'], 'properties': {'limit': {'type': 'number', 'description': '1-500, default 100'}, 'order': {'type': 'string', 'description': 'asc (default) or desc'}, 'table': {'type': 'string', 'description': 'Table name (public schema)'}, 'where': {'type': 'object', 'description': 'Column equalities', 'additionalProperties': {}}, 'app_id': {'type': 'number', 'description': 'The app id'}, 'offset': {'type': 'number'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}, 'order_by': {'type': 'string', 'description': 'Column to sort by'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'rows': {}, 'limit': {}, 'table': {}, 'offset': {}, 'has_more': {}}, 'additionalProperties': False}
read_files
Read File Contents
Read existing file contents so you can edit them SAFELY instead of rewriting blind (which risks breaking shared components/homepages). Loop: list_app_files → read_files → edit_files (change just the lines that must change) → publish_app; use write_files instead only when you are writing a whole new file. Use it to fix headers/footers, wrong phone numbers, broken links, dead forms. Works with a Read-only key. Returns { files: [{ path, content, type, bytes, truncated?, returned_bytes? }], missing }. Text is capped at 256 KiB per file and 1 MiB per call; truncated files are explicitly marked, and files beyond the call budget must be read separately.
Lecture seule
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'paths', 'context'], 'properties': {'paths': {'type': 'array', 'items': {'type': 'string'}, 'minItems': 1, 'description': "Project-relative paths to read, from list_app_files (e.g. ['src/components/Header.astro','src/components/Footer.astro'])"}, 'app_id': {'type': 'number', 'description': 'The app ID'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'files': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'content'], 'properties': {'path': {'type': 'string'}, 'type': {'type': 'string'}, 'bytes': {'type': 'number'}, 'content': {'type': 'string', 'description': 'Full text of the file. This is the payload — the text block only carries an index.'}, 'truncated': {'type': 'boolean', 'description': 'True when the file was too large to return whole; content holds the first bytes only.'}, 'returned_bytes': {'type': 'number', 'description': "How many bytes of content are actually in this result. Zero means the call's budget was spent before this file — read it on its own."}}, 'additionalProperties': False}}, 'app_id': {'type': 'number'}, 'missing': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}
rename_app
Rename Website
Rename an app's display name. Does NOT change the URL — the live address ({slug}.kleap.io) and any links to it stay intact. (There is no tool to delete the entire app; delete_files removes selected source files.)
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'name', 'context'], 'properties': {'name': {'type': 'string', 'maxLength': 100, 'minLength': 1, 'description': 'The new display name'}, 'app_id': {'type': 'number', 'description': 'The app ID to rename'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'name': {}, 'slug': {}, 'app_id': {}, 'renamed': {'type': 'boolean'}, 'production_url': {}}, 'additionalProperties': False}
retry_task
Retry Build
Resume a failed or stalled create/modify task from where it stopped — partial files are preserved. Use this when check_task reports 'failed' instead of starting a brand-new create_app. Returns a NEW task_id — poll check_task on that NEW id (not the original). Budget: retry TASK_TIMEOUT/STALE_TASK up to TWICE; retry TASK_FAILED only ONCE; then stop and tell the user. NEVER retry a non-transient error (402 INSUFFICIENT_CREDITS, a rejected prompt).
Destructif Accès externe
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['task_id', 'context'], 'properties': {'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}, 'task_id': {'type': 'string', 'description': 'The failed task_id to resume (from create_app/modify_app)'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'app_id': {}, 'status': {'type': 'string'}, 'attempt': {}, 'task_id': {}, 'parent_task_id': {}, 'files_preserved': {}}, 'additionalProperties': False}
run_database_sql
Run Database SQL
Run SQL on the app's database (owner-level, needs database:write), values as $1, $2 in params. Rows capped at 500 / 5 MB. A table left without row-level security is rolled back (RLS_REQUIRED). To just read rows, prefer query_database_rows.
Destructif
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'sql', 'context'], 'properties': {'sql': {'type': 'string', 'description': 'The SQL statement'}, 'app_id': {'type': 'number', 'description': 'The app id'}, 'params': {'type': 'array', 'description': 'Values for $1, $2, …'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'rows': {}, 'command': {}, 'warnings': {}, 'row_count': {}, 'truncated': {}}, 'additionalProperties': False}
search_domains
Search Domains
Search for available domains for a site (e.g. 'mybakery'). Returns available names across TLDs. To buy one, call buy_domain — it returns a checkout link the user pays. Use connect_domain for a domain the user already owns.
Lecture seule Accès externe
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['query', 'context'], 'properties': {'tlds': {'type': 'array', 'items': {'type': 'string'}, 'description': "Optional TLDs to check, e.g. ['.com', '.io', '.ch']"}, 'query': {'type': 'string', 'description': "Base name to search, without a TLD (e.g. 'mybakery')"}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'query': {'type': 'string'}, 'results': {}}, 'additionalProperties': False}
update_database_rows
Update Database Rows
Update the rows matching where (required, non-empty, exact matches, e.g. {"id":42}) with the values in set. Returns the updated rows.
Destructif
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'table', 'where', 'set', 'context'], 'properties': {'set': {'type': 'object', 'description': 'New values: column → value', 'additionalProperties': {}}, 'table': {'type': 'string', 'description': 'Table name (public schema)'}, 'where': {'type': 'object', 'description': 'Which rows (required)', 'additionalProperties': {}}, 'app_id': {'type': 'number', 'description': 'The app id'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'rows': {}, 'table': {}, 'updated': {}, 'truncated': {}}, 'additionalProperties': False}
wake_app
Wake Website
Use this when the user's website preview is sleeping (sandboxes auto-stop after 15 min). Takes ~30-60s to restart.
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'context'], 'properties': {'app_id': {'type': 'number', 'description': 'The app ID to wake up'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'app_id': {'type': 'number'}, 'status': {'type': 'string'}, 'preview_url': {}}, 'additionalProperties': False}
write_files
Write Files Directly
Write WHOLE files DIRECTLY — YOUR model generates the code, Kleap stores, builds and deploys it as-is. To change something in a file that ALREADY EXISTS, use edit_files instead (read_files → edit_files): it replaces just the lines you name, while write_files makes you retype the entire file and silently drops whatever you leave out — on a 30KB shared layout that is how headers and footers get wiped. No Kleap-AI step, so what ships is byte-for-byte what you wrote — the right choice when a phrase, a URL or a schema must be exact. Publishing still audits the result (see publish_app). Best for scaffolding exact pages/components — e.g. programmatic-SEO routes. Astro paths (src/pages/*.astro, src/data/*.json, src/components/*.astro, public/*). Overwrites by path. NPM PACKAGES: do not write package.json (the build replaces it) — the build installs whatever your code IMPORTS, so `import { jsPDF } from "jspdf";` is all it takes. Supported on import: @tiptap/*, jspdf, pdf-lib, html2canvas, papaparse, file-saver, jszip, @ffmpeg/*, howler, wavesurfer.js, browser-image-compression, react-dropzone, recharts, chart.js, d3, @tanstack/*, react-hook-form, three, @react-three/*, leaflet, maplibre-gl, gsap, framer-motion, zustand, date-fns, react-markdown, axios, socket.io-client, radix-ui/*, next-themes, lucide-react, @tabler/*, openai, @ai-sdk/*; anything else is refused at build with a message naming it. A client-side router is never the answer — a route is a FILE (src/pages/about.astro → /about). IMAGES AND BINARIES: set encoding:"base64" on the file and send the bytes — that is how you put a logo, a photo, an OG image, a favicon or a font on the site (png/jpg/webp/svg/ico/mp4/woff2/pdf, 512KB max each decoded). Without it you can only write text, and a site with no images looks unfinished. To ADD an image from a text prompt WITHOUT sending any bytes (a real photo's base64 is too big to emit reliably), use generate_image — Kleap generates it and stores it for you. To REMOVE a page or asset, use delete_files — overwriting it with empty content leaves a URL that answers 200 with nothing, which is worse than a 404. DATA & ACCOUNTS: write_files only STORES files — it cannot provision the Kleap Database, so DB or auth code pushed here has no backend and silently does nothing. Stand the feature up with modify_app first, then edit those pages here. After writing, call publish_app to build & go live.
Destructif
Schéma d’entrée
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'required': ['app_id', 'files', 'context'], 'properties': {'files': {'type': 'array', 'items': {'type': 'object', 'required': ['path', 'content'], 'properties': {'path': {'type': 'string', 'description': 'Project-relative path, e.g. src/pages/about.astro'}, 'content': {'type': 'string', 'description': 'Full file text — or the base64 of the bytes when encoding is "base64"'}, 'encoding': {'enum': ['utf8', 'base64'], 'type': 'string', 'description': 'Omit for text. Use "base64" to write an IMAGE or any binary (png, jpg, webp, svg, ico, mp4, woff2, pdf...). 512KB max per file decoded.'}}, 'additionalProperties': False}, 'minItems': 1, 'description': 'Files to write/overwrite: [{ path, content, encoding? }]'}, 'app_id': {'type': 'number', 'description': 'The app ID'}, 'context': {'type': 'string', 'description': 'Why this call, in one short sentence. Used to improve the connector; never include credentials or personal data.'}}}
Schéma de sortie
{'type': 'object', '$schema': 'http://json-schema.org/draft-07/schema#', 'properties': {'paths': {}, 'app_id': {'type': 'number'}, 'binary': {}, 'written': {}}, 'additionalProperties': False}
Modifié
buy_domain
29 September 2026 02:52
Ajouté
buy_domain
27 September 2026 02:44
Ajouté
run_database_sql
27 September 2026 02:44
Ajouté
delete_database_rows
27 September 2026 02:44
Ajouté
update_database_rows
27 September 2026 02:44
Ajouté
insert_database_rows
27 September 2026 02:44
Ajouté
query_database_rows
27 September 2026 02:44
Ajouté
get_database_schema
27 September 2026 02:44
Modifié
search_domains
27 September 2026 02:44
Modifié
publish_app
25 September 2026 02:52
Ajouté
connect_search_console
17 September 2026 12:42
Ajouté
get_search_console
17 September 2026 12:42
Ajouté
get_analytics
17 September 2026 12:42
Ajouté
get_form_submissions
17 September 2026 12:42
Ajouté
connect_domain
17 September 2026 12:42
Ajouté
check_domain
17 September 2026 12:42
Ajouté
search_domains
17 September 2026 12:42
Ajouté
get_publish_status
17 September 2026 12:42
Ajouté
publish_app
17 September 2026 12:42
Ajouté
wake_app
17 September 2026 12:42
Ajouté
get_credits
17 September 2026 12:42
Ajouté
retry_task
17 September 2026 12:42
Ajouté
check_task
17 September 2026 12:42
Ajouté
get_screenshot
17 September 2026 12:42
Ajouté
rename_app
17 September 2026 12:42
Ajouté
find_app
17 September 2026 12:42
Ajouté
get_app
17 September 2026 12:42
Ajouté
list_apps
17 September 2026 12:42
Ajouté
read_files
17 September 2026 12:42
Ajouté
list_app_files
17 September 2026 12:42