Skip to content

Expose the search format on the MCP tool - #679

Merged
mkreyman merged 1 commit into
masterfrom
feat/mcp-search-format
Aug 12, 2026
Merged

Expose the search format on the MCP tool#679
mkreyman merged 1 commit into
masterfrom
feat/mcp-search-format

Conversation

@mkreyman

Copy link
Copy Markdown
Owner

Server-side landed in #678; this is the half agents can actually reach.

What

knowledge_search takes format: results (default), stubs, or bodies — response
shapes of one search, not different searches. The server dispatches stubs to the same
progressive_index/3 and bodies to the same get_context/3 that
knowledge_progressive_index and knowledge_context call.

Nothing is retired. Both sibling tools stay registered and behave exactly as before. The
schema says so in words and a test asserts it, so a later reader doesn't mistake this for a
deprecation.

The description states both refusals rather than leaving an agent to discover them: stubs
and bodies require a query, and an unknown value is a 400 rather than a quiet
downgrade to results. An agent expecting a silent downgrade would read the error as an
empty corpus.

The test is deliberately not written like its neighbours

The suites here re-implement handler bodies by design — index.js has top-level await and
exports nothing. That's reasonable, but it structurally cannot catch the one failure that
matters for a pass-through parameter
: the schema advertising a field the request builder
drops. A re-implementation forwards it correctly and passes while the real code doesn't.

So this asserts against the index.js source, and I mutation-verified it catches exactly
that:

mutation result
delete params.set("format", …), leave the schema intact 1 failure
remove a shape from the enum 1 failure

A pattern, not three coincidences

This is the third instance today of one value computed or declared in one layer and
silently lost in the next, each with a green test because it checked that a thing existed
rather than what it contained:

Publishing

Version 2.74.0 with a CHANGELOG entry. Publishing to npm is a separate step and is not done
here.
Until it's published and sessions restart, agents keep the 2.73.0 schema — the same
staleness that cost the first day of search telemetry this morning.

mix precommit green (7,514). MCP suite 369 passing.

Reviewed inline (this session's system prompt forbids dispatching review agents; per CLAUDE.md
the gate is satisfied by the best available reviewer with that stated).

Server-side landed in #678; this is the half agents can actually reach.

knowledge_search takes format: results (default), stubs, or bodies. These are
response SHAPES of one search, not different searches - the server dispatches
stubs to the same progressive_index/3 and bodies to the same get_context/3 that
knowledge_progressive_index and knowledge_context call.

Nothing is retired. Both sibling tools stay registered and behave exactly as
before. The schema says so in words and a test asserts it, so a later reader
does not mistake this for a deprecation.

The description states both refusals rather than leaving an agent to discover
them: stubs and bodies REQUIRE a query, and an unknown value is a 400 rather
than a quiet downgrade to results. An agent expecting a silent downgrade would
read the error as an empty corpus.

ON THE TEST, which is deliberately not written like its neighbours. The suites
here re-implement handler bodies by design, since index.js has top-level await
and exports nothing. That strategy structurally cannot catch the one failure
that matters for a pass-through parameter: the schema advertising a field the
request builder drops. A re-implementation forwards it correctly and passes
while the real code does not. So this asserts against the index.js source, and
mutation-verified it catches exactly that - deleting the params.set line with
the schema left intact turns it red, as does removing a shape from the enum.

That is the third instance today of the same shape - a value computed or
declared in one layer and silently lost in the next, with a test green because
it checked a thing existed rather than what it contained (#669 read the wrong
keys off a result map, #672 never rendered keys onto one). Worth naming as a
pattern rather than three coincidences.

Version 2.74.0 with a CHANGELOG entry. Publishing to npm is a separate step and
is NOT done here: until it is published and sessions restart, agents keep the
2.73.0 schema - the same staleness that cost the first day of search telemetry.
@mkreyman
mkreyman enabled auto-merge (squash) August 12, 2026 18:25
@mkreyman
mkreyman merged commit b4955ca into master Aug 12, 2026
15 checks passed
@mkreyman
mkreyman deleted the feat/mcp-search-format branch August 12, 2026 18:29
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