feat(spec): updated parameters to inputSchema to match current MCP spec - #6
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the codebase to align with the current MCP (Model Context Protocol) specification by renaming parameters to inputSchema and converting the description field from a required String to an optional Option[String].
Key Changes
- Introduced a
JsonSchemacase class to properly represent JSON Schema structure withtype,properties, andrequiredfields - Updated
ToolDefinitionto useinputSchema: JsonSchemainstead ofparameters: JsonObject, madedescriptionoptional, and added new optional fields (outputSchema,title) - Refactored
NumericPairSchemato return aJsonSchemainstance instead of a rawJsonObject - Consistently updated all 10 tool implementations (arithmetic and logic tools) to use the new field names and structure
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/scala/mcp/model/mcp/ToolsProtocol.scala | Introduced JsonSchema case class, updated ToolDefinition structure with new fields, and added dropNullFields utility to omit null/None values from JSON encoding |
| src/main/scala/mcp/tools/common/NumericPairSchema.scala | Refactored to return JsonSchema instead of JsonObject, updated structure to use proper schema fields |
| src/main/scala/mcp/tools/logic/XorTool.scala | Updated to use inputSchema and optional description |
| src/main/scala/mcp/tools/logic/OrTool.scala | Updated to use inputSchema and optional description |
| src/main/scala/mcp/tools/logic/LessThanTool.scala | Updated to use inputSchema and optional description, removed trailing blank line |
| src/main/scala/mcp/tools/logic/GreaterThanTool.scala | Updated to use inputSchema and optional description |
| src/main/scala/mcp/tools/logic/EqualsTool.scala | Updated to use inputSchema and optional description |
| src/main/scala/mcp/tools/logic/AndTool.scala | Updated to use inputSchema and optional description |
| src/main/scala/mcp/tools/arithmetic/SubtractTool.scala | Updated to use inputSchema and optional description |
| src/main/scala/mcp/tools/arithmetic/MultiplyTool.scala | Updated to use inputSchema and optional description |
| src/main/scala/mcp/tools/arithmetic/DivideTool.scala | Updated to use inputSchema and optional description |
| src/main/scala/mcp/tools/arithmetic/AddTool.scala | Updated to use inputSchema and optional description |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.