MCP tools
The tools each DebugAI MCP server gives your agent, every input they take, what they return, and the errors an agent can get back.
There are three DebugAI MCP servers, and they share one account and one set of plan limits:
| Server | Who starts it | Tools |
|---|---|---|
@debugai/mcp on npm | Your MCP client, from the entry setup writes | lookup_error, debug_error, report_outcome |
| The one inside the VS Code extension | VS Code 1.101 and later, on its own | lookup_error, debug_error, report_outcome |
https://mcp.debugai.io/mcp | ChatGPT and Codex, over the network | lookup_error, debug_error, report_outcome, get_profile |
Most of this page is the npm server. The other two are at the end, with what differs.
The loop the tools are built for: call lookup_error first, since it is free. If it has no confirmed fix, call debug_error. After trying a fix, call report_outcome, so the next time that error comes back in the project, memory knows what worked. See Work with your agent.
lookup_error
Look Up Error in Project Memory. Checks whether this project has seen the error before. No model call, and it does not count against your plan. Declared hints: readOnlyHint, idempotentHint, and openWorldHint: false.
| Input | Type | Required | What it is |
|---|---|---|---|
errorText | string | yes | The error or stack trace, as you would pass it to debug_error. |
filePath | string | no | An absolute path inside the repository the error came from. |
projectRoot | string | no | The repository's absolute path, when the server started somewhere else. Memory is scoped to it. |
It answers in plain text, such as Not seen before in this project (shop). Call debug_error with the full error for an analysis., or how many times it was seen and the fix confirmed for it. Fixes reported as failed in this project come under Tried in this project recently and reported as FAILED. Do not repeat these:.
The structured result has memory_enabled, memory_disabled_reason, memory_hit, memory_times_seen, memory_fix_state (none, confirmed, unproven or anti_pattern), memory_recurrences_after_fix, memory_verified_count, last_seen_at, stored_fix, refuted (each with at, rank, title and what_happened), project and mcp_version.
The API allows 300 lookups per 15 minutes per account.
debug_error
Debug Error. Finds the root cause of an error and returns up to three ranked fixes. It uses one debug from your plan and saves the analysis to your history and the project's memory. It does not change your files. Declared hints: readOnlyHint.
| Input | Type | Required | What it is |
|---|---|---|---|
errorText | string | yes | The full error, exception or stack trace. |
language | string | no | A hint, "auto" by default. One of javascript, typescript, python, go, rust, java, csharp, cpp, c, php, ruby, kotlin, swift, lua, shell, powershell, sql, html, css, scala, dart, elixir, r, perl. Any other value is treated as "auto", never refused. |
codeSnippet | string | no | Code to analyse instead of what the server reads off disk. Only needed when the code is somewhere the trace does not name. |
snippetStartLine | integer, 1 or more | no | With codeSnippet: the line of the file the snippet's first line is. |
filePath | string | no | The file that threw. An absolute path also tells DebugAI which repository the error belongs to. |
reproCommand | string, up to 500 characters | no | The command that reproduces the failure. DebugAI never runs it. Fix 1 is aimed at making it pass, and each fix's check becomes "run this". |
expected | string, up to 500 characters | no | What reproCommand should print or do once the bug is fixed. |
projectRoot | string | no | The repository's absolute path, when the server started somewhere else. Never your home folder, a folder above it, or the filesystem root. |
Before it calls the API, the server reads the source files the stack trace names, from inside the project only: at most 3 files, none over 2 MB, 50,000 characters in all, and a window of 40 lines either side of the error in a large file. It also sends the project's declared dependencies. Error text over 3,000 characters is cut, keeping its start and end. What leaves your machine has the full list.
What it returns
The text answer, in order:
## Root Cause, then the cause in plain words.## Fixes, one block per fix, headed like**Fix 1 (82% confidence)**and the fix's title.- Under each fix, its verification line:
✓ Verifiedor✗ Failed mechanical check (confidence capped)with the reason, or· Not verified, which says the confidence is the model's own estimate. Then the description, the code,_File:_when the fix edits another file, and_Location:_. - What project memory knows about the error, when it knows something.
- A footer of badges: the files it read locally, the model, whether project code was used (
Codebase-aware: yes), whether the answer was cached, the framework, the project and where its root came from,Memory: offwhen memory is off, a note when the error text was cut, the server version and the engine build. - A reminder to call
report_outcomewith this answer'sdebugLogId.
The structured result:
| Field | What it holds |
|---|---|
schema_version | The response format version. |
root_cause | The cause, as text. |
fixes | Up to three fixes. Fields below. |
debug_log_id | The ID to pass to report_outcome. |
framework_detected, model_used, engine_version | What answered and what it recognised. |
cached, has_project_context | Whether the answer came from cache, and whether project code was used. |
error_signature | The error's normalised signature, which memory is keyed on. |
memory_hit, memory_times_seen, memory_fix_confirmed, memory_fix_state, memory_enabled | What project memory said about this error. |
local_files_read | The files the server read off disk. Empty when you passed codeSnippet. |
project | root and source, where the project came from: the argument you passed, or cwd. |
error_text_cut, mcp_version | How many characters were cut from the error, and the server version. |
Each fix has rank, title, description, confidence (0 to 100), and when they apply code, line_hint, file, verified (true, false or null, where null means nothing checked it), verification_reason, edits (exact file, old_string and new_string replacements), unified_diff, verify_with, verify_kind, verify_expect, syntax_check and previously_failed. A fix only carries edits when the change can be stated as an exact replacement. Verification explains the three states.
report_outcome
Report Fix Outcome. Records what happened after a debug_error answer. A confirmed fix is remembered for the project and handed back the next time the same error comes up there. Call it once per answer. Declared hints: idempotentHint.
| Input | Type | Required | What it is |
|---|---|---|---|
debugLogId | string | yes | The debug_log_id from the answer you are reporting on. |
result | worked, worked_modified, failed or unused | yes | See below. |
fixRank | integer, 1 to 3 | no | Which fix you applied. Leave it out for unused. |
newError | string, up to 4,000 characters | no | With failed: the error that came after the fix. |
actualFix | string, up to 4,000 characters | no | What really solved it, when it was not DebugAI's fix. |
finalFix | string, up to 4,000 characters | with worked_modified | The code that finally worked, after your changes. It is what memory keeps. |
toolFeedback | string, up to 2,000 characters | no | What would have made DebugAI more useful on this call. It goes to the people who build it, not into project memory. |
The four results:
| Result | Use it when |
|---|---|
worked | You applied a fix and the error stopped. |
worked_modified | A fix worked only after you changed it. Send the working code in finalFix. |
failed | You applied a fix and it did not help, or made things worse. |
unused | You applied none of them and solved it another way. Also the answer for a repeat call about an error you already reported. |
Use unused, not failed, when nothing of DebugAI's was run. A failed report marks a fix as tried and beaten.
It returns {"recorded": true, "result": …} and a sentence confirming what was saved.
Errors your agent can get back
Every failure comes back as a tool result with isError set, a sentence the agent can relay, and a structured error_type:
error_type | Cause | Retry? |
|---|---|---|
not_linked | No key yet. The answer carries a sign-in link and a code for the user to confirm. The client does not need a restart. | Yes, after the user confirms |
auth_failed | The key was rejected (HTTP 401 or 403). The fix is npx -y @debugai/mcp login --force. | No |
quota_exceeded | The daily debug limit is used up (HTTP 402). It says when it resets. | No |
monthly_ceiling | A paid account reached its monthly usage ceiling (HTTP 429). It resets on the 1st (UTC). | No |
rate_limited | Too many requests in a short window (HTTP 429). It says how many seconds to wait, 60 when the API gives no figure. | Yes, after the wait |
invalid_request | The API refused the arguments (HTTP 400) and says why. The same call is refused the same way. | No, change the arguments |
not_found | The debug_log_id is not one this account was given (HTTP 404), or DEBUGAI_API_BASE points somewhere wrong. | No |
engine_unavailable | The engine is down for a moment (HTTP 503 or 504). It points to https://status.debugai.io. | Yes, in 30 to 60 seconds |
network_error | The request never reached the API: offline, a proxy, or a wrong DEBUGAI_API_BASE. | Yes, once the network is back |
unknown | Anything else. | Yes |
quota_exceeded and monthly_ceiling tell the agent plainly not to retry, because the same call is refused until the limit resets. Plans and limits has the numbers.
The server inside the VS Code extension
VS Code 1.101 and later starts it on its own, under the name DebugAI, for agent mode. It has the same three tools with the same inputs. What differs:
- It uses the key from the extension's sign-in. If the key is rejected, it tells the user to run DebugAI: Set API Key from the Command Palette.
- Its project is the first folder open in VS Code.
projectRootis for an error from somewhere else.filePathdoes not name a project here. - Its waits are fixed: 150 seconds for
debug_error, 15 forreport_outcomeand 8 forlookup_error.DEBUGAI_TIMEOUT_MSdoes not apply. - Its footer reads
DebugAI MCPwith the version and(VS Code), and its status link ishttps://debugai.io/status.
See VS Code agent mode.
The remote server, for ChatGPT and Codex
https://mcp.debugai.io/mcp is a Streamable HTTP server. You sign in to your DebugAI account through OAuth, with Clerk as the sign-in service; ChatGPT or Codex offers the sign-in the first time a tool needs it. Setup: ChatGPT and Codex.
It sees only what each call carries. It cannot read your files or run code, so the agent has to pass the error, and any code, in the call.
| Tool | Title | Inputs |
|---|---|---|
lookup_error | Look up an error in DebugAI memory | errorText, project |
debug_error | Analyse an error | errorText, codeSnippet, snippetStartLine, fileName, language, project |
report_outcome | Record whether a fix worked | debugLogId, result, fixRank, finalFix, newError, actualFix |
get_profile | Show the connected DebugAI account | none |
What differs from the npm server:
- Projects are names.
projectis a short name such asbilling-api, and memory is kept per name. A call that names none uses the projectchatgpt, so ChatGPT and Codex share one memory unless you name projects. fileNameis a file name or a relative path, not a full path from your computer.- Sizes.
errorTextis cut to 3,000 characters, keeping its start and end, andcodeSnippetto its first 20,000 characters.finalFix,newErrorandactualFixtake up to 20,000 characters each. There is notoolFeedback. - The engine gets 50 seconds to answer on this path.
- Reports wait for a real try. A
report_outcomeon an analysis less than 30 seconds old is refused, exceptunused, because nobody can have tried a fix that fast. get_profilereturns anidthat means nothing outside DebugAI, and your display name.
The structured results use camelCase. debug_error returns outcome (analysed or not_an_error), debugLogId, rootCause, fixes, memory, debugsLeftToday and repeated. Each fix has rank, title, confidence, explanation, verification (passed, failed or not_checked), verificationNote, code, file, location, edits, checkCommand and previouslyFailed. lookup_error returns project, seenBefore, timesSeen, lastSeenDate, fixState, storedFix, confirmation and failedFixes. report_outcome returns recorded, alreadyRecorded and result.
Declared hints: lookup_error and get_profile are read-only and idempotent. debug_error is neither, since it spends a debug and saves the analysis. report_outcome is idempotent and marked destructive, because a fix reported as worked replaces the one memory had.
Related
- MCP CLI: installing the npm server and the Claude Code hook.
- Plans and limits
- Error memory