Skip to content

Commit e544a58

Browse files
anandgupta42claude
andcommitted
fix(mcp): restore the compound-request rule in the compact answer_commit description
The compact description dropped the guidance and worked example for requests that name an entity and a related item, and clients then committed a single field. Restore it in short form (+221 chars): never collapse a compound request into one field ('the repository and the most copied file' needs two), and an item that only selects the answer is not asked. Tests: `server.test.ts` (ALTIMATE_MCP_E2E=1) asserts the rule is advertised; size caps raised to 2,250 (`answer_commit`) and 6,250 (all tools). Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d2d9edc commit e544a58

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎packages/opencode/src/altimate/mcp-server/adapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const descriptions: Record<string, string> = {
2828
sql_check: "Read-only data check: fanout, keys, grain, nulls or coverage.",
2929
sql_materialize: "Store a read-only query's rows as a scratch table, to join across connections.",
3030
answer_commit:
31-
"Finish a data question; call last, then reply with exactly its FINAL ANSWER text. Use one of fields, rows or unresolved, with a field (or rows column) per asked item, named after it. Numbers may be your own computation; exact decimals as strings.",
31+
"Finish a data question; call last, then reply with exactly its FINAL ANSWER text. Use one of fields, rows or unresolved, with a field (or rows column) per asked item, named after it. Never collapse a compound request into one field: 'the repository and the most copied file' needs two. An item that only selects the answer ('the customer with the largest invoice') is not asked. Numbers may be your own computation; exact decimals as strings.",
3232
}
3333

3434
/**

‎packages/opencode/test/altimate/mcp-server/server.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,8 +833,9 @@ mcpTest("tool definitions stay compact and keep their required properties", asyn
833833
const size = (tool: (typeof tools)[number]) =>
834834
JSON.stringify({ name: tool.name, description: tool.description, inputSchema: tool.inputSchema }).length
835835
const byName = Object.fromEntries(tools.map((tool) => [tool.name, tool]))
836-
expect(size(byName.answer_commit!)).toBeLessThanOrEqual(2_000)
837-
expect(tools.reduce((total, tool) => total + size(tool), 0)).toBeLessThan(6_000)
836+
expect(size(byName.answer_commit!)).toBeLessThanOrEqual(2_250)
837+
expect(byName.answer_commit!.description).toContain("'the repository and the most copied file' needs two")
838+
expect(tools.reduce((total, tool) => total + size(tool), 0)).toBeLessThan(6_250)
838839
expect(client.getInstructions()!.length).toBeLessThanOrEqual(723)
839840
const declared = JSON.stringify(tools)
840841
expect(declared).not.toContain("$schema")

0 commit comments

Comments
 (0)