[PR #1479] [MERGED] perf(mcp): stop advertising placeholder input descriptions #2917

Closed
opened 2026-10-17 21:11:48 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1479
Author: @kaoru0822-kitauji
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: perf/mcp-drop-placeholder-input-descriptions


📝 Commits (1)

  • f3906ab perf(mcp): stop advertising placeholder input descriptions

📊 Changes

4 files changed (+31 additions, -22 deletions)

View changed files

📝 src/contracts/inputSchemaPresentation.ts (+10 -10)
📝 src/contracts/toolInputReferences.test.ts (+6 -1)
📝 src/contracts/toolSchemaMetadata.ts (+3 -2)
📝 tests/boundary/mcp/toolSchemaValidity.test.ts (+12 -9)

📄 Description

Summary

presentInputJsonSchema fills in a description for every input property that has none. The last-resort fallback is `Value for ${words}.`, for example "Value for browser.", "Value for procedure.", "Value for frames.". That sentence only repeats the property name. Today it is used for 1,958 properties across the advertised input schemas.

Clients send input schemas to the model as tool definitions, so this text costs context in every session that loads the REA catalog.

This change:

  • makes the fallback return undefined for names that match no meaningful pattern, and presentInputJsonSchema then leaves description off;
  • keeps authored descriptions, descriptions inherited through $ref, PROPERTY_DESCRIPTIONS, and the pattern-based sentences that add meaning (max_*, include_*, expected_*, *_sha256, *_evidence_id(s), *_path, *_uri, *_bytes, *_root(s), is_*/has_*);
  • leaves output schemas unchanged, because the fallback only ran on input schemas.

Measured effect

MCP tools/list from dist/main.js (139 tools, no target):

main this branch
sum of inputSchema JSON 522,270 450,365 (−13.8%)

Test invariant change

tests/boundary/mcp/toolSchemaValidity.test.ts used to require a description on every advertised input property. #1162 reaffirmed that rule. In practice the rule only held because of the placeholder above. The test now walks the same properties, including through $ref, and rejects empty or Value for … descriptions instead. With main's toolSchemaMetadata.ts it fails at annotate_native_function.procedure: 'Value for procedure.', so it catches a reintroduced placeholder. In toolInputReferences.test.ts, the prototype-key case (constructor) now asserts that no description is inherited from Object.prototype.

If you would rather keep "every property is described", this PR also shows where descriptions are missing: the 1,958 properties that relied on the placeholder.

Verification

  • npx vitest run src/contracts src/server passes.
  • npm run test:focused on the schema, catalog, identity, contract, presentation and prompt suites under tests/boundary/mcp passes (10 files, 56 tests).
  • npm run check:fast and npm run docs:check pass.
  • No real Hopper or Ghidra verification was needed: this only changes schema presentation.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1479 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `perf/mcp-drop-placeholder-input-descriptions` --- ### 📝 Commits (1) - [`f3906ab`](https://github.com/morluto/rea/commit/f3906abb19b0f145d12584ddb32c9b26b8fa6eb0) perf(mcp): stop advertising placeholder input descriptions ### 📊 Changes **4 files changed** (+31 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/contracts/inputSchemaPresentation.ts` (+10 -10) 📝 `src/contracts/toolInputReferences.test.ts` (+6 -1) 📝 `src/contracts/toolSchemaMetadata.ts` (+3 -2) 📝 `tests/boundary/mcp/toolSchemaValidity.test.ts` (+12 -9) </details> ### 📄 Description ## Summary `presentInputJsonSchema` fills in a description for every input property that has none. The last-resort fallback is `` `Value for ${words}.` ``, for example `"Value for browser."`, `"Value for procedure."`, `"Value for frames."`. That sentence only repeats the property name. Today it is used for **1,958 properties** across the advertised input schemas. Clients send input schemas to the model as tool definitions, so this text costs context in every session that loads the REA catalog. This change: - makes the fallback return `undefined` for names that match no meaningful pattern, and `presentInputJsonSchema` then leaves `description` off; - keeps authored descriptions, descriptions inherited through `$ref`, `PROPERTY_DESCRIPTIONS`, and the pattern-based sentences that add meaning (`max_*`, `include_*`, `expected_*`, `*_sha256`, `*_evidence_id(s)`, `*_path`, `*_uri`, `*_bytes`, `*_root(s)`, `is_*`/`has_*`); - leaves output schemas unchanged, because the fallback only ran on input schemas. ## Measured effect MCP `tools/list` from `dist/main.js` (139 tools, no target): | | main | this branch | |---|---|---| | sum of `inputSchema` JSON | 522,270 | 450,365 (−13.8%) | ## Test invariant change `tests/boundary/mcp/toolSchemaValidity.test.ts` used to require a description on every advertised input property. #1162 reaffirmed that rule. In practice the rule only held because of the placeholder above. The test now walks the same properties, including through `$ref`, and rejects empty or `Value for …` descriptions instead. With `main`'s `toolSchemaMetadata.ts` it fails at `annotate_native_function.procedure: 'Value for procedure.'`, so it catches a reintroduced placeholder. In `toolInputReferences.test.ts`, the prototype-key case (`constructor`) now asserts that no description is inherited from `Object.prototype`. If you would rather keep "every property is described", this PR also shows where descriptions are missing: the 1,958 properties that relied on the placeholder. ## Verification - `npx vitest run src/contracts src/server` passes. - `npm run test:focused` on the schema, catalog, identity, contract, presentation and prompt suites under `tests/boundary/mcp` passes (10 files, 56 tests). - `npm run check:fast` and `npm run docs:check` pass. - No real Hopper or Ghidra verification was needed: this only changes schema presentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:11:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2917
No description provided.