Skip to content

feat(spec): updated parameters to inputSchema to match current MCP spec - #6

Merged
Alexandre-Roussel48 merged 1 commit into
mainfrom
feat/input-schema
Nov 16, 2025
Merged

Alexandre-Roussel48 merged 1 commit into
mainfrom
feat/input-schema

Conversation

@Alexandre-Roussel48

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 JsonSchema case class to properly represent JSON Schema structure with type, properties, and required fields
  • Updated ToolDefinition to use inputSchema: JsonSchema instead of parameters: JsonObject, made description optional, and added new optional fields (outputSchema, title)
  • Refactored NumericPairSchema to return a JsonSchema instance instead of a raw JsonObject
  • 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.

@Alexandre-Roussel48
Alexandre-Roussel48 merged commit cb69601 into main Nov 16, 2025
7 checks passed
@Alexandre-Roussel48
Alexandre-Roussel48 deleted the feat/input-schema branch November 16, 2025 01:21
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