Skip to content

Commit c75cfce

Browse files
committed
fix: correct the ordering of the as tool name aliases for MCP servers
Signed-off-by: Donnie Adams <[email protected]>
1 parent 6edde57 commit c75cfce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/mcp/loader.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,12 @@ func (l *Local) sessionToTools(ctx context.Context, session *Session, toolName s
234234
}
235235

236236
if tool.Annotations.Title != "" && !slices.Contains(strings.Fields(tool.Annotations.Title), "as") {
237-
toolDef.Name = tool.Annotations.Title + " as " + tool.Name
237+
toolNames = append(toolNames, tool.Name+" as "+tool.Annotations.Title)
238+
} else {
239+
toolNames = append(toolNames, tool.Name)
238240
}
239241

240242
toolDefs = append(toolDefs, toolDef)
241-
toolNames = append(toolNames, tool.Name)
242243
}
243244

244245
main := types.Tool{

0 commit comments

Comments
 (0)