Skip to content

fix(mcp): Use typed input and outputs in the mcp server#625

Merged
thokra-nav merged 2 commits intomainfrom
mcp-fixes
Dec 19, 2025
Merged

fix(mcp): Use typed input and outputs in the mcp server#625
thokra-nav merged 2 commits intomainfrom
mcp-fixes

Conversation

@thokra-nav
Copy link
Contributor

Modern LLMs requires full json schema for MCP tools

Modern LLMs requires full json schema for MCP tools
@github-actions
Copy link
Contributor

📝 Changelog preview

Below is a preview of the Changelog that will be added to the next release. Only commit messages that follow the Conventional Commits specification will be included in the Changelog.

v3.25.1 - 2025-12-19

Full Changelog: v3.25.0...v3.25.1

🐛 Bug Fixes

  • (mcp) Use typed input and outputs in the mcp server (d1454da)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the MCP server implementation by migrating from untyped map-based tool schemas to fully typed input/output structures. Modern LLMs require complete JSON schemas for MCP tools, and this change provides compile-time type safety and automatic schema generation.

Key changes:

  • Introduced strongly-typed input and output structures for all 12 MCP tools
  • Replaced manual parameter extraction with automatic deserialization via NewStructuredToolHandler and NewTypedToolHandler
  • Converted error handling from mcp.NewToolResultError to standard Go error returns

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
internal/mcp/tools/types.go New file defining typed input/output structures for all schema exploration and GraphQL execution tools
internal/mcp/tools/schema.go Refactored 9 schema tool handlers to use typed inputs/outputs, removed manual JSON marshaling helper
internal/mcp/tools/graphql.go Updated 3 GraphQL tool handlers with typed parameters and cleaner error handling
internal/mcp/tools/schema_test.go Updated test to validate typed field formatting instead of map-based output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thokra-nav thokra-nav merged commit 00dd90d into main Dec 19, 2025
19 checks passed
@thokra-nav thokra-nav deleted the mcp-fixes branch December 19, 2025 11:02
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