MCP Tools Reference
See MCP Tools in the Concepts section for the full reference.
Structured Error Responses (v2.0.0)
All MCP tools return structured error responses with machine-readable error codes.
Error Response Format
json
{
"error": "Human-readable error message",
"code": "VALIDATION_ERROR",
"retryable": false,
"details": {
"field": "title",
"provided": "",
"suggestion": "Provide a non-empty title"
}
}Error Codes
| Code | Category | Retryable | When to expect |
|---|---|---|---|
VALIDATION_ERROR | INVALID | No | Bad input arguments (wrong type, missing required field, invalid enum) |
NOT_FOUND | MISSING | Yes | Resource doesn't exist (issue, project, PR, comment) |
PERMISSION_DENIED | FORBIDDEN | No | Operation not allowed (missing labels, wrong agent type) |
PRECONDITION_FAILED | STATE | Yes | Wrong state for operation (invalid status transition, contract version mismatch) |
CONFLICT | DUPLICATE | No | Duplicate creation, dependency cycle, same-project move |
INTERNAL_ERROR | INTERNAL | Yes | Unexpected failure (DB error, filesystem error) |
Retry Strategy
- Check
retryablefield - iffalse, fix arguments before retrying - For
NOT_FOUND: verify the resource ID/path exists, then retry - For
PRECONDITION_FAILED: check current state (issue status, phase), adjust, then retry - For
INTERNAL_ERROR: wait briefly, then retry once - For
VALIDATION_ERROR/PERMISSION_DENIED/CONFLICT: fix the root cause, don't blindly retry
Details Field
The details object varies by error but commonly includes:
field- which argument was invalidprovided- the value that was givenvalid_phases/valid_transitions- allowed valuesissue_id/project_id- resource identifierssuggestion- how to fix the errorcurrent_status/requested_status- state transition context
Backward Compatibility
Legacy error responses (plain { "error": "..." } without code) may still appear from the error() function's string overload. Agents should check for the code field's presence before relying on structured error handling.