Skip to content

Commit d1a4d55

Browse files
committed
fix: correct export name in TypeScript tool template generation
Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
1 parent bbcd9ea commit d1a4d55

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

pkg/cli/internal/frameworks/common/base_generator.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ func (g *BaseGenerator) GenerateToolFile(filePath string, config templates.ToolC
129129
// Prepare template data
130130
toolName := config.ToolName
131131
toolNamePascalCase := cases.Title(language.English).String(toolName)
132+
toolNameCamelCase := strcase.LowerCamelCase(toolName)
132133
data := map[string]interface{}{
133134
"ToolName": toolName,
135+
"ToolNameCamelCase": toolNameCamelCase,
134136
"ToolNameTitle": cases.Title(language.English).String(toolName),
135137
"ToolNameUpper": strings.ToUpper(toolName),
136138
"ToolNameLower": strings.ToLower(toolName),
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { z } from 'zod';
22

3-
const {{.ToolName}}Schema = z.object({
3+
const {{.ToolNameCamelCase}}Schema = z.object({
44
// Define your tool parameters here
55
// Example:
66
// input: z.string().describe('Input parameter description'),
77
});
88

9-
const {{.ToolName}} = {
9+
const {{.ToolNameCamelCase}} = {
1010
name: '{{.ToolName}}',
1111
description: '{{.Description}}',
12-
inputSchema: {{.ToolName}}Schema,
13-
handler: async (params: z.infer<typeof {{.ToolName}}Schema>) => {
12+
inputSchema: {{.ToolNameCamelCase}}Schema,
13+
handler: async (params: z.infer<typeof {{.ToolNameCamelCase}}Schema>) => {
1414
// Implement your tool logic here
1515
// Example:
1616
// const { input } = params;
@@ -22,4 +22,4 @@ const {{.ToolName}} = {
2222
},
2323
};
2424

25-
export { {{.ToolName}} };
25+
export { {{.ToolNameCamelCase}} };

0 commit comments

Comments
 (0)