Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

MCP protocol and errors

find_precedents finds recent session evidence for a failed resume, failed tool, or missing price. Call it through POST /mcp/precedents with a workspace precedent credential.

Arguments

Both fields are required. The advertised input schema allows no additional properties.
ArgumentValuesMeaning
segmentcoding, managed, businessMatch the session's segment.
findingfailed_resume, failed_tool, missing_priceSelect the observation pattern to match.
FindingExact observation fields matched
failed_resumekind: "resume" and failed: true.
failed_toolkind: "tool_receipt" and state: "failed".
missing_pricekind: "usage" and an explicit usd_micros: null.
Other observation fields may be present. missing_price matches an explicit JSON null; an absent usd_micros field does not match that pattern.

Request

{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "find_precedents", "arguments": { "segment": "coding", "finding": "failed_tool" } } }

Response

A successful call returns HTTP 200 with a JSON-RPC result. Its content array contains one text item. Parse that item's text as JSON to obtain the evidence array.
{ "jsonrpc": "2.0", "id": 2, "result": { "content": [ { "type": "text", "text": "[{\"session\":\"01946b00-0000-7000-8000-000000000001\",\"event\":\"tool-failed-1\",\"task\":\"fix-build\",\"attempt\":\"attempt-1\"}]" } ] } }
The identifiers above are illustrative. Each evidence item contains these string fields:
FieldMeaning
sessionSession UUID.
eventMatching event identifier.
taskTask identifier from the matching event.
attemptAttempt identifier from the matching event.
Results are restricted to the credential's workspace and sessions that are not deleted and have not expired. They are ordered by event recording time descending, then event ID ascending, with a fixed limit of eight. Several results may refer to the same session. The tool has no cursor, text query, time-range argument, or caller-selected limit.
With no matches, the text item contains "[]". A successful empty response is not an authentication error.

Errors

JSON-RPC errors return HTTP 200 with an error object in place of result:
{ "jsonrpc": "2.0", "id": 2, "error": { "code": -32602, "message": "Unknown finding" } }
CodeMessageCause
-32601Unknown methodUnsupported method, or notifications/initialized sent with a non-null ID.
-32602Unknown toolTool name is not find_precedents.
-32602Unknown segmentMissing or unsupported segment.
-32602Unknown findingMissing or unsupported finding.
Authentication, body validation, and storage failures use an HTTP error response with a JSON body such as {"error":"Service credential required"}:
HTTP statusMessageCause
400Invalid structured dataBody cannot be decoded as the expected JSON object.
400Unexpected trailing dataData follows the first JSON value.
400Expected JSON-RPC 2.0jsonrpc is missing or differs from "2.0".
401Service credential requiredMissing Bearer authorization or token length outside 32–256 characters.
401Unknown service credentialToken has no valid workspace mapping.
403API key route unavailableA scoped hs_ API key was used.
403Use a configured MCP clientRequest includes an Origin header.
413Request body exceeds the size limitDecoding exceeds the 256 KiB body limit.
503Service credentials unavailableServer credential configuration is missing or invalid.
503Storage is temporarily unavailableStorage or another unclassified server operation failed.