fix: normalize MCP tool error formatting
This commit is contained in:
+12
-1
@@ -105,9 +105,20 @@ Four additional MCP tools registered on the server (`src/server.js`):
|
||||
- All handlers use existing modules only (no new imports or files).
|
||||
- SDK quirk: `isError: true` wraps results in JSON-RPC error envelope (`code: -32603`).
|
||||
|
||||
### Task 5.4 - Normalize MCP tool error formatting ✅
|
||||
|
||||
MCP tool error formatting normalized in `src/server.js`. All 5 tool registrations now produce a single "Error:" prefix — no more duplicate `"Error: Error:"` strings.
|
||||
|
||||
**Changes:** Each tool callback normalizes the error text before returning:
|
||||
- If `result.error` already starts with `"Error:"`, it is used as-is.
|
||||
- Otherwise, `"Error: "` is prepended.
|
||||
- `result.ok` responses are unchanged.
|
||||
|
||||
Smoke tests: npm test 523 passed ✅ · tools/list 5 tools ✅ · ask_chatgpt single prefix ✅ · review_plan single prefix ✅
|
||||
|
||||
## Next Pending
|
||||
|
||||
### Task 5.4 - Normalize MCP tool error formatting
|
||||
### Task 5.5 - Claude Code MCP configuration and local end-to-end setup
|
||||
|
||||
## General Rules
|
||||
|
||||
|
||||
Reference in New Issue
Block a user