Skip to main content

Tools reference

The Ductape MCP server exposes three tools. All responses are JSON text in MCP content blocks. Errors return isError: true with a message string.


ductape_execute

Execute any allowed Ductape SDK operation via the backend proxy at POST /proxy/v1/sdk-proxy/execute.

Arguments

ArgumentTypeRequiredDescription
publishable_keystringYesWorkspace publishable key for authentication
moduleenumYesSDK module name (see Modules & methods)
methodstringYesMethod name; use dot notation for nested methods (e.g. schema.create, messages.query)
paramsarrayNoPositional arguments matching the SDK signature. Defaults to [].

Response

Returns the SDK method result as formatted JSON. On failure, returns Error: <message>.

Examples

Fetch a product:

{
"publishable_key": "pk_...",
"module": "product",
"method": "fetch",
"params": ["ductape:my-product"]
}

Query a database:

{
"publishable_key": "pk_...",
"module": "databases",
"method": "query",
"params": [{
"product": "ductape:my-product",
"env": "prd",
"database": "main-db",
"entity": "users",
"where": { "status": { "$eq": "active" } },
"limit": 10
}]
}

Run an app action:

{
"publishable_key": "pk_...",
"module": "actions",
"method": "run",
"params": [{
"product": "ductape:my-product",
"env": "prd",
"app": "stripe",
"action": "create-customer",
"input": {
"body:email": "user@example.com",
"body:name": "Jane Doe"
}
}]
}

Vector similarity search:

{
"publishable_key": "pk_...",
"module": "vector",
"method": "findSimilar",
"params": [{
"product": "ductape:my-product",
"env": "prd",
"vector": "embeddings-index",
"values": [0.1, 0.2, 0.3],
"topK": 5
}]
}

Nested method — list product environments:

{
"publishable_key": "pk_...",
"module": "product",
"method": "environments.list",
"params": ["ductape:my-product"]
}

Parameter order

params is a JSON array of positional arguments in the same order as the TypeScript SDK. For example, databases.update expects:

"params": [{
"product": "...",
"env": "...",
"database": "...",
"entity": "...",
"data": { "name": "Updated" },
"where": { "id": { "$eq": "123" } }
}]

See Method reference for every signature.


ductape_generate_payload

Generate canonical executable payload templates from POST /integrations/v1/payloads/generate. Use this when an agent needs structured payload context before writing SDK code.

Arguments

ArgumentTypeRequiredDescription
workspace_idstringYesWorkspace ID
user_idstringYesUser ID
public_keystringYesWorkspace public key (sent as x-access-key)
product_tagstringYesProduct tag (e.g. ductape:my-product)
env_slugstringYesEnvironment slug (prd, stg, etc.)
operation_familystringYesExecutable family (see Code generation)
methodstringYesExecution method (run, dispatch, query, etc.)
targetsobjectNoComponent targeting (database tag, action tag, etc.)
schema_modeenumNostrict or best_effort (default: best_effort)
include_sessionbooleanNoInclude session tags/context (default: true)
include_cachebooleanNoInclude cache tags/context (default: true)
input_hintobjectNoOptional schema/input hint for payload generation

Response

{
"payload": { /* canonical executable payload template */ },
"meta": { /* schema context, validation info, warnings, inferred tags */ }
}

Example

{
"workspace_id": "ws_abc123",
"user_id": "usr_xyz789",
"public_key": "pk_...",
"product_tag": "ductape:my-product",
"env_slug": "prd",
"operation_family": "database",
"method": "query",
"targets": { "database": "main-db" },
"input_hint": { "entity": "orders", "limit": 10 }
}

ductape_generate_snippet

Builds on payload generation and returns both the backend payload response and a ready-to-copy SDK code snippet.

Arguments

Same as ductape_generate_payload, plus:

ArgumentTypeRequiredDescription
languageenumNotypescript (default) or python

Response

{
"payload": {
"payload": { /* template */ },
"meta": { /* metadata */ }
},
"snippet": "// TypeScript or Python source code string"
}

Example

{
"workspace_id": "ws_abc123",
"user_id": "usr_xyz789",
"public_key": "pk_...",
"product_tag": "ductape:my-product",
"env_slug": "prd",
"operation_family": "action",
"method": "run",
"targets": { "app": "stripe", "action": "create-customer" },
"language": "typescript"
}

Supported snippet operations

Not every SDK method has snippet support. The server validates against an allowlist before generation. See Code generation — Supported snippet operations.


Tool selection guide

GoalTool
Run a live operation nowductape_execute
Understand payload shape before codingductape_generate_payload
Hand an engineer copy-paste SDK codeductape_generate_snippet
Agent explores data / mutates platform stateductape_execute
Copilot scaffolds integration boilerplateductape_generate_snippet

Error handling

All tools catch exceptions and return text content with isError: true. Common errors:

ErrorCause
Not authenticated. Please provide the publishable_key...Missing publishable_key on execute
Proxy request failed: 4xxInvalid module/method or params rejected by proxy
Unsupported snippet operation "family.method"Snippet tool called with unsupported operation family/method pair
Payload generation request failedInvalid workspace credentials or backend validation error