diff --git a/pkg/cli/internal/frameworks/common/base_generator.go b/pkg/cli/internal/frameworks/common/base_generator.go index 34d2ac3..e2f16e5 100644 --- a/pkg/cli/internal/frameworks/common/base_generator.go +++ b/pkg/cli/internal/frameworks/common/base_generator.go @@ -129,8 +129,10 @@ func (g *BaseGenerator) GenerateToolFile(filePath string, config templates.ToolC // Prepare template data toolName := config.ToolName toolNamePascalCase := cases.Title(language.English).String(toolName) + toolNameCamelCase := strcase.LowerCamelCase(toolName) data := map[string]interface{}{ "ToolName": toolName, + "ToolNameCamelCase": toolNameCamelCase, "ToolNameTitle": cases.Title(language.English).String(toolName), "ToolNameUpper": strings.ToUpper(toolName), "ToolNameLower": strings.ToLower(toolName), diff --git a/pkg/cli/internal/frameworks/typescript/templates/src/tools/tool.ts.tmpl b/pkg/cli/internal/frameworks/typescript/templates/src/tools/tool.ts.tmpl index 1c1c7af..0f7bd1a 100644 --- a/pkg/cli/internal/frameworks/typescript/templates/src/tools/tool.ts.tmpl +++ b/pkg/cli/internal/frameworks/typescript/templates/src/tools/tool.ts.tmpl @@ -1,16 +1,16 @@ import { z } from 'zod'; -const {{.ToolName}}Schema = z.object({ +const {{.ToolNameCamelCase}}Schema = z.object({ // Define your tool parameters here // Example: // input: z.string().describe('Input parameter description'), }); -const {{.ToolName}} = { +const {{.ToolNameCamelCase}} = { name: '{{.ToolName}}', description: '{{.Description}}', - inputSchema: {{.ToolName}}Schema, - handler: async (params: z.infer) => { + inputSchema: {{.ToolNameCamelCase}}Schema, + handler: async (params: z.infer) => { // Implement your tool logic here // Example: // const { input } = params; @@ -22,4 +22,4 @@ const {{.ToolName}} = { }, }; -export { {{.ToolName}} }; +export { {{.ToolNameCamelCase}} };