REQ-MCP-019: Tool results are size-capped with a marker and classified into typed kinds

← Requirements

What it requires

  1. Given cap 0 or content within cap, Then truncate_to_cap is a no-op; Given oversized content, Then the final size is <= cap and ends with the truncation marker; Given "Error: ..." / "[error] ..." / {"error":...}, Then looks_like_tool_error is true; given the word error mid-sentence, false; given whitespace-only content, is_effectively_empty is true.
tier
NOT_RUN

Where it lives

  • src/mcp7

See it on the map

How it is met

implemented byresults (65 tests)apply_result_size_capclassify_tool_resultfinalize_tool_callis_effectively_emptylooks_like_tool_errorstarts_with_json_errortruncate_to_cap65 absent65 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (65)

Reached through calls

65 tests: 65 absent

testresultlinked byimplementers exercisedcalls away
gh#150: a suppressed external call is REPORTED as a failureabsentinferred2 of 7: looks_like_tool_error, starts_with_json_error1
looks_like_tool_error negative casesabsentinferred2 of 7: looks_like_tool_error, starts_with_json_error1
looks_like_tool_error positive casesabsentinferred2 of 7: looks_like_tool_error, starts_with_json_error1
is_effectively_empty bucketabsentinferred1 of 7: is_effectively_empty1
truncate_to_cap is a no-op when cap is 0absentinferred1 of 7: truncate_to_cap1
truncate_to_cap is a no-op when content is already within capabsentinferred1 of 7: truncate_to_cap1
truncate_to_cap shrinks oversized content with a marker tailabsentinferred1 of 7: truncate_to_cap1
A call that fails identically is refused rather than retried absentinferred7 of 73
Anti-spiral hard block stops dispatch and emits absentinferred7 of 73
Anti-spiral hard block uses derived default when sentinel setabsentinferred7 of 73
Auto approve skips callbackabsentinferred7 of 73
Chained POST_TOOL_CALL hooks: last write winsabsentinferred7 of 73
Circuit breaker at threeabsentinferred7 of 73
Duplicate counter resetsabsentinferred7 of 73
Duplicate detection skipsabsentinferred7 of 73
Error result not cached for dedupabsentinferred7 of 73
Headless mode denies without callbackabsentinferred7 of 73
Max tool calls per turnabsentinferred7 of 73
Multiple tool calls in batchabsentinferred7 of 73
POST_TOOL_CALL fires on duplicate rejection with kindabsentinferred7 of 73
POST_TOOL_CALL fires on schema rejection with kindabsentinferred7 of 73
POST_TOOL_CALL hook transforms duplicate-rejection contentabsentinferred7 of 73
POST_TOOL_CALL hook transforms schema-rejection contentabsentinferred7 of 73
POST_TOOL_CALL hook transforms successful tool result contentabsentinferred7 of 73
POST_TOOL_CALL with *modified_json == NULL leaves content untouchedabsentinferred7 of 73
PRE/POST_TOOL_CALL fire for successful callsabsentinferred7 of 73
PRE_TOOL_CALL cancel short-circuits dispatch and still fires POSTabsentinferred7 of 73
Permission denied returns feedbackabsentinferred7 of 73
Process single tool callabsentinferred7 of 73
Schema validation rejects invalid enum valueabsentinferred7 of 73
Schema validation rejects missing required fieldabsentinferred7 of 73
Tool call history records successful executionsabsentinferred7 of 73
Tool emits directives → ToolExecutor extracts + dispatches themabsentinferred7 of 73
Tool executor processes calls via ServerManagerabsentinferred7 of 73
effective_max_tool_calls_per_turn overrides global limitabsentinferred7 of 73
gh#111: POST_TOOL_CALL hook returning malformed UTF-8 is absentinferred7 of 73
gh#143: an argument-free call serialises as an object absentinferred7 of 73
gh#143: an argument-free call to a no-required-fields tool absentinferred7 of 73
gh#143: dispatch converts a throwing tool into a tool errorabsentinferred7 of 73
gh#168: a rewritten payload carrying bad UTF-8 is sanitized, absentinferred7 of 73
gh#168: the rewrite is visible to the dup cache and POST hookabsentinferred7 of 73
gh#190: a structured JSON error counts as a failure everywhereabsentinferred7 of 73
gh#211: a tier that declares an EMPTY allowlist may call nothingabsentinferred7 of 73
gh#83: allowlisted tool dispatches normallyabsentinferred7 of 73
gh#83: empty locked_tier bypasses enforcementabsentinferred7 of 73
gh#83: no map wired = pass-through (pre-v2.5.2 behavior)absentinferred7 of 73
gh#83: off-allowlist tool is rejected_unauthorized at dispatchabsentinferred7 of 73
gh#83: tier with no allowlist entry is unrestrictedabsentinferred7 of 73
mcp.bash.timeout_seconds reaches the dispatched bash serverabsentinferred7 of 73
process_single_call completes with locked_tier setabsentinferred7 of 73
v2.14.0: schema validation enforces declared minimum and maximumabsentinferred7 of 73
v2.14.6: a headless host still dispatches engine directivesabsentinferred7 of 73
gh#158: a delegated child's read satisfies its parent's write — absentinferred7 of 74
gh#158: a session's tool call never resolves inside another absentinferred7 of 74
gh#158: repeated sandbox swaps race nothing a concurrent absentinferred7 of 74
gh#158: two sessions reading and writing through ONE filesystem absentinferred7 of 74
gh#158: two sessions writing todos through ONE entropic server absentinferred7 of 74
gh#168: a PRE_TOOL_CALL hook's modified args reach the toolabsentinferred7 of 74
gh#168: a malformed modification is refused, not half-appliedabsentinferred7 of 74
gh#168: a modification that renames the tool is refusedabsentinferred7 of 74
gh#168: a non-zero return still cancels, modification or notabsentinferred7 of 74
gh#158: clearing the default conversation releases the default absentinferred7 of 75
gh#158: each session's todo list is its ownabsentinferred7 of 75
gh#158: ending a session's conversation releases its read absentinferred7 of 75
gh#158: read-before-write is judged per session — another absentinferred7 of 75