From 87d1a64cf2ce0a37ab542cc7cb83dd0c5e42d7cb Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Sun, 5 Apr 2026 16:22:35 +0000 Subject: [PATCH] docs(spec): document MCP 1.4.0 error extraction from content[0].text in MCPToolAdapter The MCPToolAdapter execute() section now documents the MCP 1.4.0 error response protocol: when isError is true, the error message is extracted from content[0].text rather than a non-standard top-level error key. Falls back to 'unknown error' when content is absent or malformed. This aligns the spec with the implementation fix in PR #2600 and the approved proposal in issue #3330. ISSUES CLOSED: #3330 --- docs/specification.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/specification.md b/docs/specification.md index 4accaad8b..dbe7bd381 100644 --- a/docs/specification.md +++ b/docs/specification.md @@ -22063,6 +22063,7 @@ Bridges external MCP servers into the tool model: - Creates a checkpoint if the tool is marked checkpointable After the MCP tool returns its `content[]` response, the adapter: + - **Error detection**: If `isError: true` is present in the response, the error message is extracted from `content[0].text` per the MCP 1.4.0 protocol (the non-standard top-level `error` key is not used). Falls back to `"unknown error"` when `content` is absent or malformed. - Parses the result into the CleverAgents `Result` format - Records any resource mutations as `Change` objects in the plan's `ChangeSet` -- 2.52.0