add-mcp-tools
Guide for adding new MCP tools with consistent patterns for schemas, tool definitions, registry updates, and Better Auth…
Script against the org's MCP tools from inside the sandbox — discover schemas under .deco/tools/, call one tool from the shell with `typegen call`, or batch many calls in a script. Use whenever a task needs repeated or bulk tool calls (same tool many times, one call per
$ npx -y skills add decocms/studio --skill tool-scripting --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/tool-scriptingContext preview
The summary Claude sees to decide when to auto-load this skill.
Script against the org's MCP tools from inside the sandbox — discover schemas under .deco/tools/, call one tool from the shell with `typegen call`, or batch many calls in a script. Use whenever a task needs repeated or bulk tool calls (same tool many times, one call per
name: tool-scripting description: Script against the org's MCP tools from inside the sandbox — discover schemas under .deco/tools/, call one tool from the shell with `typegen call`, or batch many calls in a script. Use whenever a task needs repeated or bulk tool calls (same tool many times, one call per file/row/item) instead of one-at-a-time agent tool calls.
The workspace carries a materialized catalog of the org's tools:
`{ name, description, inputSchema, outputSchema }`
The `typegen` CLI and client discover it automatically (walking up from cwd) — no flags, keys, or env needed. The daemon refreshes it; a reconnect picks up new credentials.
Browse the catalog from disk instead of loading every schema into context:
ls .deco/tools/ cat .deco/tools/SEND_EMAIL.json
or `typegen tools` (list names + descriptions) / `typegen tools SEND_EMAIL` (one tool's full schema).
typegen call SEND_EMAIL '{"to":"ada@example.com","subject":"hi"}'Prints the tool's structured output as JSON; non-zero exit and a message on stderr on failure. If `typegen` is not on PATH, use `bunx @decocms/typegen call ...`.
For N calls (a tool per row/file/item), never loop through your own tool-calling — write a script, run it, read back the summary. Results belong in a file, not in your context.
Set up a scratch project so the user's repo stays untouched. Cloud sandboxes carry the typegen package built from the same Studio revision; Desktop falls back to the published package. Then run from the repo root (endpoint discovery walks up from cwd):
mkdir -p /tmp/toolrun && cd /tmp/toolrun if [ -f /opt/sandbox-daemon/typegen.tgz ]; then bun add /opt/sandbox-daemon/typegen.tgz else bun add @decocms/typegen fi cd - && bun run /tmp/toolrun/bulk.ts
// /tmp/toolrun/bulk.ts
import { createStudioClient } from "@decocms/typegen";
const client = createStudioClient(); // discovers .deco/tools/.endpoint.json
const rows: { email: string }[] = JSON.parse(
await Bun.file("input.json").text(),
);
const out = Bun.file("results.jsonl").writer();
let ok = 0;
let failed = 0;
for (const [i, row] of rows.entries()) {
try {
const result = await client.SEND_EMAIL({ to: row.email, subject: "hi" });
out.write(`${JSON.stringify({ i, ok: true, result })}\n`);
ok++;
} catch (err) {
out.write(`${JSON.stringify({ i, ok: false, error: String(err) })}\n`);
failed++;
}
if (i % 25 === 0) console.error(`progress ${i}/${rows.length}`);
}
out.end();
await client.close();
console.log(JSON.stringify({ ok, failed, total: rows.length }));Determinism rules:
when the tool is safe to call in parallel.
crash, and failures are greppable afterwards.
retry the call once — the reconnect re-reads the endpoint file, which the daemon refreshes.
N raw results.
typegen --output client.ts
generates a `client.ts` with one typed method per tool from the same endpoint, for larger scripts where input/output types help.
Open-source control plane for your AI agents. Connect tools, hire agents, track every token and dollar
Guide for adding new MCP tools with consistent patterns for schemas, tool definitions, registry updates, and Better Auth…
Prepare code for review by running quality checks, creating conventional commits, and opening pull requests. Use when the user…
Run Studio locally with chats and task runs executing in real Freestyle sandboxes, reachable through an ngrok tunnel. Use when…
Operate the user's deco Studio (decocms) organization from the terminal with their own login. Use when the user asks to read or…
Create and maintain an org's brand as a folder the whole platform reads: colors, type, voice, logo and a deck theme. Use this…
Read and extract text, tables, and structure from .docx Word documents. Use when the user uploads or references a Word file to…