Skip to content

Conversation

@burmudar
Copy link
Contributor

@burmudar burmudar commented Nov 27, 2025

add subcommand to mcp to list the various tools parsed from the mcp tool json

Part of SRCH-2167

Test plan

executed locally

@burmudar
Copy link
Contributor Author

burmudar commented Nov 27, 2025

@burmudar burmudar self-assigned this Nov 27, 2025
@burmudar burmudar force-pushed the wb/parse-mcp-tool-json branch from b795d99 to 73b6673 Compare November 28, 2025 09:27
@burmudar burmudar force-pushed the wb/parse-mcp-tool-json branch from 73b6673 to 4c6a6bd Compare December 2, 2025 09:46
@burmudar burmudar force-pushed the wb/mcp-list-tools branch 2 times, most recently from 27719e1 to 2414ed5 Compare December 2, 2025 10:10
@burmudar burmudar marked this pull request as ready for review December 2, 2025 14:40
@burmudar burmudar changed the title add mcp list-tools to list available tool calls feat(mcp): add mcp list-tools to list available tool calls Dec 2, 2025
@burmudar burmudar force-pushed the wb/parse-mcp-tool-json branch from 33e5f58 to 711d1bf Compare December 5, 2025 09:35
@burmudar burmudar force-pushed the wb/mcp-list-tools branch 2 times, most recently from 80a7854 to d837a9c Compare December 5, 2025 10:19
@burmudar burmudar force-pushed the wb/parse-mcp-tool-json branch from e9da8bb to ea3325b Compare December 5, 2025 10:25
@burmudar burmudar force-pushed the wb/parse-mcp-tool-json branch from ea3325b to 89494c8 Compare December 8, 2025 10:08
fmt.Printf(" • %s\n", name)
}
fmt.Println("\nUSAGE:")
fmt.Printf(" • Invoke a tool\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: Why not just a normal ascii * instead of unicode stars? Ignore me if I am too much of an ASCII lover.

Name: t.Name,
// normalize the raw mcp tool name to be without the mcp identifiers
rawName := t.Name
name, _ := strings.CutPrefix(rawName, "sg_")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trimprefix?

var r RawSchema
if err := json.Unmarshal(raw, &r); err != nil {
d.errors = append(d.errors, fmt.Errorf("failed to parse property %q: %w", name, err))
d.errors = append(d.errors, errors.Newf("failed to parse property %q: %w", name, err))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors.Wrapf(err, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants