omnigraph/crates/omnigraph-cli
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
..
src Route registry selection through one shared query_entries_for 2026-05-30 21:53:07 +02:00
tests Refuse duplicate MCP tool names across exposed stored queries 2026-05-30 22:05:18 +02:00
Cargo.toml Rename repo terminology to graph (#118) 2026-05-24 16:46:00 +01:00