Skip to content

feat(mcp): add machine-readable tool errors - #76

Merged
NovusEdge merged 4 commits into
mainfrom
codex/mcp-error-contract
Sep 6, 2026
Merged

feat(mcp): add machine-readable tool errors#76
NovusEdge merged 4 commits into
mainfrom
codex/mcp-error-contract

Conversation

@NovusEdge

Copy link
Copy Markdown
Owner

MCP tool failures expose a stable error code so callers can handle missing VMs, access refusals, and rate limits without parsing prose. The first text block retains the existing message. A second JSON text block and namespaced metadata carry the same error object.

Existing success schemas and typed handler output remain unchanged. The two new refusal codes are access_denied and rate_limited. Existing JSON-message redaction runs before the message is copied into the new fields.

Validation: separate test-author and implementation commits; expected failures reproduced before implementation; just check, just lint, and just test passed. In-process MCP client tests cover sentinel mapping, refusal messages, JSON escaping and redaction, and success-schema compatibility. Sol reviewed the complete change, followed by one focused correction and final verification. No guest or boot behavior changes.

Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
Signed-off-by: NovusEdge <novusedge0@gmail.com>
@NovusEdge NovusEdge self-assigned this Sep 6, 2026
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: bc21bc27-aa43-4fb9-8f6a-27e7cb6364d0

📥 Commits

Reviewing files that changed from the base of the PR and between bbb62d8 and db792c0.

📒 Files selected for processing (7)
  • docs/reference/json.md
  • docs/reference/mcp.md
  • internal/cli/wire/errors.go
  • internal/mcpsrv/access.go
  • internal/mcpsrv/error_contract_test.go
  • internal/mcpsrv/ratelimit.go
  • internal/mcpsrv/server.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NovusEdge
NovusEdge merged commit ecd4e44 into main Sep 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant