Repository navigation
fix(mcp): keep detail guidance in compact input schemas - #8034
Conversation
Compact input schemas are the default advertisement since morluto#5975, and the profile drops every property description. On 23 of the 31 tools with a guided `detail` option, including inspect_artifact and inspect_macho, `detail` is advertised as a bare complete|summary enum, so callers take the complete default. On a universal macOS app that reply was about 699k characters for inspect_artifact and 336k for inspect_macho, against about 4.4k and 3.2k with summary. Keep the canonical description of a root `detail` property in the inline compact input form. The reduced form already keeps first-level guidance, and compact output schemas are unchanged. Advertised compact input schemas grow from 127,616 to 133,358 bytes across 233 tools; the largest schema stays at 4,107 bytes, within the 13,312-byte budget. The new boundary test compares `detail` guidance between the full and compact tools/list and fails before the change.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Low impact] The PR appears safe to merge; no actionable defects were found. SummaryPreserves existing root
Reviews (1) · Last reviewed commit: "fix(mcp): keep detail guidance in compac..." · Reviewed by Greptile |
Summary
Compact input schemas are the default advertisement since #5975. In them,
detailis advertised as a barecomplete|summaryenum with no description on 23 of the 31 tools that describe it in the full profile. On a universal macOS app, the default complete reply was about 699k characters forinspect_artifact(about 175k tokens) and 336k forinspect_macho(about 84k tokens). Withdetail=summarythe same calls returned about 4.4k and 3.2k characters. In a run with a local model and a 131k context (LM Studio, Qwen 27B), complete replies filled the context before the model wrote any answer.This keeps the contract's
detaildescription in the compact profile.No issue is linked. I hit this while running REA from LM Studio on that app.
Problem and expected behavior
Trigger:
tools/listwith the default (compact) profile.inspect_artifact,inspect_macho,analyze_function,binary_session,decode_interface_builder,list_strings,search_proceduresand 16 other tools describedetailin the full profile but not in compact. The inline compact form strips all nested descriptions, while the reduced form already keeps first-level guidance.Expected: a caller on the compact profile can see that
summaryexists and keeps the complete Evidence retained.Change and scope
compactAdvertisedInputSchemainsrc/contracts/compactInputSchema.tsrestores the description of a rootdetailproperty after annotations are stripped and local references are expanded. The text is the contract's own, so the contract stays the single owner of the wording. Other annotations stay stripped, and the sharedstripAnnotationsincompactJsonSchema.tsis unchanged, so compact output schemas do not change.docs/mcp-contracts.mddocuments the exception.Not included: 14 tools (for example
inspect_android_package,inspect_dart_aot,analyze_javascript_application,get_evidence_bundle) have nodetaildescription in either profile. That is a contract change and is left for a follow-up.Contribution scope: ordinary fix within existing boundaries; not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage: compact input-schema presentation (
src/contracts/compactInputSchema.ts).Contribution scope fit and linked maintainer decision: not applicable.
CLI and MCP/tool-catalog contract: compact
tools/listinput schemas only. Full profile, output schemas, tool descriptions and canonical validation are unchanged. The compact catalog digest changes.Provider, bridge, target-format, or platform compatibility: compact input schemas grow from 127,616 to 133,358 bytes across 233 tools (+5,742, +4.5%). The largest schema stays at 4,107 bytes, within the 13,312-byte budget.
Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details: not applicable.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Launch or attach to a process.
Inject instrumentation or run scripts/code.
Change process memory, registers, files, or configuration.
Contact network services.
Recover protected code or work around protections.
Documentation or usability only; no target interaction.
Not sure yet; investigation or maintainer guidance needed.
Evidence and regression coverage
keeps root detail guidance so callers can choose bounded summariesintests/boundary/mcp/compactInputSchemaMcp.test.tslists the full and compact catalogs through the MCP transport and requires equaldetaildescriptions.expected { …(8) } to deeply equal { …(31) }. It passes with the change. The reply sizes in the summary come from MCPtools/callon rea 6.7.0 against a real universal macOS app.inspect_machodetailnow reads{"type":"string","enum":["complete","summary"],"description":"Omitted or complete returns the complete inspection Evidence. summary retains that complete Evidence in this session and returns its inspect_analysis_view summary; use normalized_result.parent_evidence_id for macho pages."}.Validation performed
npm run test:focused -- tests/boundary/mcp/compactInputSchemaMcp.test.ts src/contracts/compactInputSchema.test.ts tests/conformance/contracts/mcpInputSchemaProfile.test.ts tests/boundary/mcp/toolInputAdmission.test.ts tests/boundary/mcp/outputSchemaProfile.test.ts: 5 files, 70 tests passednpm run check:fast: passednpm run verify:test-discovery: all 2840 test files discovered oncenpm run docs:check: passedCompatibility, safety, and release
Author readiness
Human owner: @cpruijsen
Before merge
type(scope): outcome.