omnigraph/crates/omnigraph-server
Ragnor Comerford 36c3a16dba
Refuse duplicate MCP tool names across exposed stored queries
The effective MCP tool name (explicit tool_name, else the query name) is a
second identity namespace beside the registry key, but nothing enforced it
unique — two exposed queries could claim one catalog key, and each consumer
re-derived the name ad hoc.

Add StoredQuery::effective_tool_name() as the one definition, and a
load-time uniqueness pass in from_specs over exposed queries: a collision is
a collected LoadError naming the loser and the winner. Scoped to exposed
queries (unexposed have no MCP tool); deterministic over the BTreeMap so the
first-declared wins and the error order is stable.

New (rare) refusal: a config with colliding exposed tool names now fails
`omnigraph queries validate` offline and refuses server boot, the same
posture as a malformed registry. Release-note-worthy.

Test-first: duplicate_exposed_tool_name_is_a_load_error (red before the
pass, green after) + a CLI offline test; the unexposed sibling pins the
exposed-only scope; effective_tool_name asserts folded into the load test.
2026-05-30 22:05:18 +02:00
..
examples feat: inline query strings in CLI and HTTP server (#110) 2026-05-29 13:41:54 +02:00
src Refuse duplicate MCP tool names across exposed stored queries 2026-05-30 22:05:18 +02:00
tests Load and type-check stored queries at server boot, refusing breakage 2026-05-30 20:45:35 +02:00
Cargo.toml (feat): multi-graph server mode (#119) 2026-05-28 16:19:31 +02:00