Skip to content

CTX7-3290: Clearer Admin MCP error messages - #3525

Merged
enesgules merged 1 commit into
masterfrom
CTX7-3290/admin-mcp-errors
Oct 23, 2026
Merged

enesgules merged 1 commit into
masterfrom
CTX7-3290/admin-mcp-errors

Conversation

@enesgules

Copy link
Copy Markdown
Collaborator

Error messages an agent can act on.

  • Order: a tool without third-party data now answers The Context7 API answered HTTP 404 not_found: Rule not found. <next step>. Before, the API message came after the status line, inside JSON. Other body fields still follow as JSON.
  • Untrusted tools unchanged: for tools whose results hold third-party text, the API message may repeat that text, so the body stays inside the untrusted-data fence (as before, and as an API error body of an untrusted tool is fenced too tests). Only the status and a validated error code lead.
  • 404: also says that an id of another teamspace answers 404, and to check teamspace.
  • 5xx: says the failure is temporary: try again in a minute, tell the user if it repeats.
  • Network failure or timeout: says to read the state with a get_ or list_ tool before a write is tried again, because the change may be saved.

Tests: 30 pass (1 new).

- An API error leads with status, code and message (tools without third-party
  data), then the next step; untrusted tools keep the whole body fenced.
- 404 says an id of another teamspace also answers 404.
- 5xx says the failure is temporary and to retry later.
- A network failure says to read the state before a write is retried.
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
context7-admin-mcp Ignored Ignored Oct 23, 2026 1:21pm UTC

Request Review

@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown

CTX7-3290

@ramazanoacar ramazanoacar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, these read much better for an agent. Putting the status, code and message on one line, while keeping the message inside the fence for untrusted tools, is a nice balance, and checking the code against ^[a-z0-9_]+$ is a good touch.

Suggestions (non-blocking)

  • The 5xx hint says "Try again in a minute". A 502 or 504 can come back after the write was already saved, which is the same situation as the network-failure case. For write calls, maybe reuse that advice: "read the state with the matching get_ or list_ tool before you try again".
  • The network-failure message adds . after reason, so a reason that already ends with a period becomes ... You could reuse the /[.!?]$/ check from the message path.

@enesgules
enesgules merged commit b5e81de into master Oct 23, 2026
4 checks passed
@enesgules
enesgules deleted the CTX7-3290/admin-mcp-errors branch October 23, 2026 13:48
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.

2 participants