Skip to content

Add McpActionBuilder class - #1716

Open
guidorc wants to merge 4 commits into
masterfrom
mcp-action-builder
Open

Add McpActionBuilder class#1716
guidorc wants to merge 4 commits into
masterfrom
mcp-action-builder

Conversation

@guidorc

@guidorc guidorc commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements McpActionBuilder, which converts MCP tool's inputSchema into a structured ObjectGene action gene. This replaces the previous placeholder that created an empty ObjectGene("input", emptyList()) for every tool, so MCP tool-call actions now expose their real, typed arguments to the search.

The builder reuses existing RestActionBuilderV3 by first converting the tool's JSON Schema into OpenAPI Schema Objects.

Changes

  • JsonSchemaToOpenApiConverter: converts an MCP tool's JSON Schema (2020-12 dialect, the MCP default) into a flat map of OpenAPI 3.1 Schema Objects.
  • new overload for RestActionBuilderV3.createGeneForDTOs: a JsonNode entry point that builds a gene from a set of related schemas.
  • McpActionBuilder: builds one McpToolCallAction per tool, registers it in the action cluster, and accumulates warnings for unsupported schema constructs.
  • McpSampler.discoverTools(): now delegates to McpActionBuilder.addActionsFromToolList(...) instead of the placeholder loop; logs any conversion warnings. Also tracks each tool's declared outputSchema.
  • McpBlackBoxFitness: replaces the hand-rolled gene→map walker (geneToMap/extractGeneValue) with getValueAsPrintableString(JSON) + a single Jackson parse to build the tools/call arguments object.
  • McpDTOs: adds outputSchema to McpToolDefinition, and adds McpProtocolError (mirroring the JSON-RPC 2.0 error object) plus protocolError fields on tool/resource results.

@guidorc
guidorc marked this pull request as ready for review August 31, 2026 23:11
@guidorc
guidorc requested a review from Pgarrett August 31, 2026 23:11
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.

1 participant