You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make every tool-reachable error name its field and a next step #227
An agent recovers from a failure by reading the error. Most docs.plus errors do not say enough to recover from.
Measured: 148 sites return an ad-hoc c.json({ error: '...' }) against 58 that call the house fail(c, ...) helper. Ten of the ad-hoc sites sit in the core document controller, not in the email or admin corners that apps/hocuspocus.server/API.md:73 names.
A validation failure names no field. A well-formed body and a nonsense body both return the same thing:
A person opens API.md and squints. An agent cannot, so it retries the same wrong call.
What to do
Wire the house envelope across the ad-hoc sites, starting with the ten in apps/hocuspocus.server/src/api/controllers/documents.controller.ts.
Make each validation failure name the field that failed and the next step.
Acceptance
Every tool-reachable failure returns the house envelope with a specific code.
A validation failure names the offending field.
The import route's shape is the model to copy: it already answers Expected a file in the 'documentFile' field.
Notes
This is a gate, not tidiness. Connector directory review rejects a generic error, and requires every tool to return a successful response for valid parameters.
The 429 path already does this correctly. It uses the house envelope and sets Retry-After, and it is the one error an agent can handle today.
Scope this to the tool-reachable surface. A full sweep of all 148 sites is a separate job.
Done for the surface in scope. Validation errors name each field (f2afc0dad), and every MCP tool error names its field and a next step (toolContext.ts, documentTools.ts). MCP tools call the stores directly and never call REST, so the remaining ad-hoc REST error sites cannot reach a tool. This issue put a full REST sweep out of scope.
Activity
feat(hocuspocus): add the MCP connector at /api/mcp
HMarzban commentedon Sep 29, 2026
Done for the surface in scope. Validation errors name each field (
f2afc0dad), and every MCP tool error names its field and a next step (toolContext.ts,documentTools.ts). MCP tools call the stores directly and never call REST, so the remaining ad-hoc REST error sites cannot reach a tool. This issue put a full REST sweep out of scope.