george43g/mcp-cli-starter-template/mcp-tool-author

Claude Code and agent skill by george43g/mcp-cli-starter-template

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Authoring checklist for adding new MCP tools to a example tool. Use whenever the user asks to add or modify a tool.

Install

npx vskill@latest install george43g/mcp-cli-starter-template/mcp-tool-author

SKILL.md

The same SKILL.md was published earlier as george43g/mcp-cli-starter-template/mcp-tool-author.

Adding an MCP tool — canonical checklist

Use this skill whenever the user asks to add, modify, or refactor an MCP tool in any repo cloned from mcp-cli-starter-template. Following this checklist keeps every tool in the codebase uniform and avoids subtle robustness bugs (missing timeouts, ignored abort signals, unsanitized output).

1. Define the schemas

Two Zod schemas — input and output — .describe() every field:

ts
export const FooInputSchema = z.object({
query: z.string().describe("Search query; substring match, case-insensitive"),
limit: z.number().int().min(1).max(500).default(20).describe("Max results"),
});
export const FooOutputSchema = z.object({
results: z.array(z.object({ id: z.string(), title: z.string() })),
total: z.number().int(),
});

If the schema mirrors a Rust struct, declare it in @george43g/shared-types and register the entry in MIRRORED_SCHEMAS. Otherwise keep it inline in src/tools/<name>.ts.

2. Write the ToolDefinition

ts
export const fooTool: ToolDefinition<typeof FooInputSchema, typeof FooOutputSchema> = {
name: "foo",
description: "One paragraph summary the LLM will see. State purpose, when to use, when NOT to.",
input: FooInputSchema,
output: FooOutputSchema,
annotations: {
readOnlyHint: true, // does it read state only?
destructiveHint: false, // does it overwrite/delete anything?
idempotentHint: true, // does calling twice == calling once?
openWorldHint: false, // does it call external systems?
},
timeoutMs: 30_000, // omit to use the 30s default
handler: async (input, signal) => {
if (signal?.aborted) throw new Error("Cancelled by client");
// ... your work here ...
return { results: [...], total: 42 };
},
};

3. Honor the invariants

Encoded by @george43g/mcp-kit's buildDispatcher, but you must follow them in your handler:

  1. Timeout — the wrapper sets one for you; just don't make the work unbounded inside.
  2. Activity beacon — handled by the dispatcher.
  3. Perf span — handled by the dispatcher; if you want sub-spans inside, use perf("sub-span").
  4. Actionable errors — throw new Error("clear message..."). The dispatcher wraps with the tool name and hint.
  5. Abort signal — check signal?.aborted between iterations of any long loop. Return early if true.
  6. No stdout writes — log via @george43g/robustness/logger only. Never console.log after the stdio transport opens.
  7. Sanitize external content — pass user-content surfaces through sanitize(). Wrap with wrapUntrusted() when the content came from outside your control (web scrape, email body, etc).

4. Register the tool

Add to apps/example/src/tools/registry.ts:

ts
import { fooTool } from "./foo.js";
// ...
return makeRegistry([healthCheckTool, noopTool, fooTool, getLogsTool]);

5. Add an integration test

apps/example/tests/integration.test.ts:

ts
describe("foo", () => {
it("returns results matching the schema", async () => {
const r = await callMcpTool("foo", { query: "test" });
expect(r.isError).toBeUndefined();
expect((r.structuredContent as any).total).toBeGreaterThanOrEqual(0);
});
});

6. Stress harness — only if lifecycle-affecting

If the tool can block the event loop, spawn subprocesses, hold network connections, or otherwise affect process health, add a stress case to apps/example/scripts/stress-mcp.ts. Run pnpm stress to verify.

7. Documentation

  • Update the tool table in apps/example/README.md if there is one.
  • Update AGENTS.md if the tool needs special handling notes (auth, permissions, etc).
  • VHS tape: only update if the tool changes the user-facing CLI subcommand list.

8. Verify

bash
pnpm verify # lint + typecheck + test + build
pnpm --filter @george43g/example stress # 11-case robustness suite

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/george43g/mcp-cli-starter-template/mcp-tool-author/badge)](https://verified-skill.com/skills/george43g/mcp-cli-starter-template/mcp-tool-author)

Something wrong with this skill or its page? Tell us.