fix(mcp): make signals shortcut tools return data via templated selections#300
Merged
Conversation
…tions telemetry_get_signals_time_series and telemetry_get_latest_signals selected only timestamp/lastSeen because mcpgen cannot express field-selection arguments, so both returned empty data. Override the two ToolDefinitions at startup using server-garage v0.3.0 SelectionTemplate + ToolOnly args: the model passes a signal list to the tool, the selection set is rendered at call time, and the GraphQL schema stays untouched.
…ools OverrideMCPTools now returns an error if either expected tool name is absent, so an mcpgen rename breaks startup instead of silently shipping the original empty-selection tools. Tests cover patching, input immutability, the missing-tool error, and that rendered templates parse as valid GraphQL.
The MCP path used a bare executor, bypassing everything registered on the HTTP GraphQL server: DCX credit tracking, complexity limit, query recording, metrics, and the error presenter. With the shortcut tools now returning real data, that gap meant unbilled, unrecorded, uncapped signal access over MCP. configureGQLExtensions holds the single shared extension list and is applied to both *handler.Server and *executor.Executor (via the new server-garage ExecutorOption hook). server-garage is pinned to a pre-release commit of DIMO-Network/server-garage#38; bump to the tagged release once it lands.
Member
Author
|
Two follow-up commits from review findings:
|
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.
Problem
telemetry_get_signals_time_seriesandtelemetry_get_latest_signalsreturned empty data. The underlying GraphQL fields (signals,signalsLatest) name signals by field-selection (e.g.speed(agg: AVG)), which mcpgen's static per-tool query strings can't express — so both tools shipped selecting onlytimestamp/lastSeen.Fix
OverrideMCPToolspatches the two generated ToolDefinitions at startup using server-garage v0.3.0 features:__MCPGEN_SELECTION__placeholder in the query).signalRequests/signalNames) let the model pass the signal list to the tool without the argument flowing through to the GraphQL executor.GraphQL schema untouched. Bumps server-garage v0.1.1 → v0.3.0.
Testing
go build ./...and fullgo test ./...pass.🤖 Generated with Claude Code