feat(mcpserver): executor options + strict selection template keys#38
Merged
Conversation
NewGQLGenExecutor now accepts ExecutorOption funcs so services can register gqlgen handler extensions (billing, complexity limits, query recording) and error presenters on the MCP executor path — previously the bare executor silently bypassed everything configured on the HTTP GraphQL server via server.Use. SelectionTemplate now parses with missingkey=error so a call omitting a templated key gets a clear render error instead of '<no value>' spliced into the executed GraphQL query.
zer0stars
added a commit
to DIMO-Network/telemetry-api
that referenced
this pull request
Jun 12, 2026
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.
The unpinned 'latest' install pulled v2.12.2, whose release artifact fails the installer's sha256 verification, breaking every CI run. Pin the version and fetch install.sh from the version tag, matching the telemetry-api Makefile convention.
zer0stars
added a commit
to DIMO-Network/telemetry-api
that referenced
this pull request
Jun 12, 2026
…tions (#300) * fix(mcp): make signals shortcut tools return data via templated selections 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. * fix(mcp): fail startup when override targets missing from generated tools 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. * fix(mcp): apply shared gqlgen extensions to MCP executor 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. * chore: bump server-garage to v0.4.0
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.
Why
NewGQLGenExecutorbuilds a bareexecutor.New(es)— none of the gqlgen handler extensions a service registers on its HTTP GraphQL server (server.Use) apply on the MCP path. In telemetry-api that means MCP tool calls bypass DCX credit tracking, complexity limits, query recording, and the error presenter.What
ExecutorOption:NewGQLGenExecutor(es, opts ...ExecutorOption)— variadic, source-compatible. Callers get the underlying*executor.Executorto register extensions / set an error presenter, so HTTP and MCP paths behave identically.missingkey=erroron SelectionTemplate parsing: a tool call omitting a templated key (e.g. asignalRequestsentry withoutagg) now returns a clear render error instead of splicing<no value>into the executed GraphQL query.Testing
TestGQLGenExecutorAppliesOptions— extension registered via option intercepts responses.TestSelectionTemplateMissingKeyReturnsToolError— missing key surfaces as tool error, executor never called.Follow-up: telemetry-api PR DIMO-Network/telemetry-api#300 wires its extension set into the MCP executor using this.
🤖 Generated with Claude Code