Skip to content

Commit f2cb1bb

Browse files
committed
fix(codegen): improve Claude Agent SDK tool template stub
Replace TODO comment with proper developer guidance: - Add @remarks and @example JSDoc sections with implementation pattern - Change silent stub to throw Error with clear message - Remove misleading "MCP bridge" comment (bridge is user-implemented) The stub now fails fast if called without implementation, making it clear that developers need to provide their own logic.
1 parent 2b1810b commit f2cb1bb

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

crates/mcp-codegen/templates/claude_agent/tool.ts.hbs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ import { z } from "zod";
33

44
/**
55
* {{description}}
6+
*
7+
* @remarks
8+
* This is a generated stub. Replace the implementation below with your actual tool logic.
9+
* The Zod schema provides type-safe argument validation.
10+
*
11+
* @example
12+
* ```typescript
13+
* // Example implementation connecting to an API:
14+
* async (args) => {
15+
* const result = await yourApi.{{typescript_name}}(args);
16+
* return { content: [{ type: "text", text: JSON.stringify(result) }] };
17+
* }
18+
* ```
619
*/
720
export const {{typescript_name}} = tool(
821
"{{name}}",
@@ -13,14 +26,9 @@ export const {{typescript_name}} = tool(
1326
{{/each}}
1427
},
1528
async (args) => {
16-
// TODO: Implement tool logic
17-
// This is a stub - actual implementation depends on MCP bridge
18-
return {
19-
content: [{
20-
type: "text" as const,
21-
text: JSON.stringify({ tool: "{{name}}", args })
22-
}]
23-
};
29+
// Stub implementation - replace with your actual tool logic
30+
// See JSDoc above for example implementation patterns
31+
throw new Error("Tool '{{name}}' not implemented. Replace this stub with your implementation.");
2432
}
2533
);
2634

0 commit comments

Comments
 (0)