Skip to content

Replace struct initialization with mcp convinience method #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

karthikraobr
Copy link

This PR updates how mcp.CallToolResult is initialized, switching from direct struct initialization to using the mcp.NewToolResultText convenience method.

Sidenote - This was done using the following regex on vscode -
SEARCH - &mcp\.CallToolResult\{ Content: \[\]mcp\.Content\{ mcp\.TextContent\{ Type: "text", Text: (.*), \}, \},
REPLACE - mcp.NewToolResultText($1)

Screenshot 2025-05-25 at 19 07 39

@rhnvrm
Copy link
Member

rhnvrm commented Jun 11, 2025

Thanks for the PR, we have refactored something similar when we updated to the latest mcp-go lib version.

@rhnvrm rhnvrm closed this Jun 11, 2025
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.

2 participants