You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mcp-tools.md
+52-16Lines changed: 52 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,22 +25,50 @@ All tools are **read-only** (`readOnlyHint: true`). Pass **`format: "json"`** fo
25
25
26
26
## JSON responses
27
27
28
-
Payloads are minified (`JSON.stringify`, no pretty-print). `MCP_JSON_FORMAT_VERSION` is **`"1"`**. Optional fields are omitted when empty/null.
28
+
Payloads are minified (`JSON.stringify`, no pretty-print). `MCP_JSON_FORMAT_VERSION` is **`"2"`**. Optional fields are omitted when empty/null.
29
+
30
+
### Error envelope
31
+
32
+
Tool-level failures return a top-level `error` object:
33
+
34
+
```jsonc
35
+
{
36
+
"error": {
37
+
"code":"NOT_FOUND",
38
+
"message":"PR Rethunk-AI/github-mcp#42 not found.",
39
+
"retryable":false,
40
+
"suggestedFix":"Verify the PR number."// optional
41
+
}
42
+
}
43
+
```
44
+
45
+
Per-item failures (inside arrays like `repos[]` or `pins[]`) follow the same envelope shape in the item's `error` field. The batch does not fail as a whole when a per-item failure occurs.
46
+
47
+
Agents can decide programmatically whether to retry (e.g. exponential backoff on `retryable: true`) vs. surface the problem to the user (`retryable: false`).
29
48
30
49
### Error codes
31
50
32
-
| Code | Meaning |
33
-
|------|---------|
34
-
|`github_auth_missing`| No `GITHUB_TOKEN`/`GH_TOKEN` and `gh auth token` failed. |
35
-
|`not_found`| Repository, PR, or workflow run does not exist. |
36
-
|`no_ci_runs`| No workflow runs found for the given ref/PR. |
37
-
|`org_not_found`| GitHub organization does not exist or is inaccessible. |
38
-
|`local_repo_no_remote`| Local path has no resolvable GitHub `origin` remote. |
|`UPSTREAM_FAILURE`| GitHub 5xx or GraphQL-level error. |**yes**|
60
+
|`NO_CI_RUNS`| No workflow runs found for the given ref/PR (`ci_diagnosis`). | no |
61
+
|`COMPARE_FAILED`| Reserved: `base...head` comparison failure distinct from a 404. | no |
62
+
|`LOCAL_REPO_NO_REMOTE`| Local path has no resolvable GitHub `origin` remote. | no |
63
+
|`UNSUPPORTED_LANGUAGE`|`module_pin_hint` was called with a `language` other than `"go"`. | no |
64
+
|`AMBIGUOUS_REPO`| Reserved: pin source does not encode which GitHub repo a value belongs to. | no |
65
+
|`INTERNAL`| Unrecognized/unexpected failure. | no |
66
+
67
+
### Idempotency
68
+
69
+
All current tools are **read-only** (`readOnlyHint: true`) and therefore idempotent: calling any tool twice with the same arguments is equivalent to calling it once. There is no server-side state mutation. Safe to retry transparently on `RATE_LIMITED` or `UPSTREAM_FAILURE`.
70
+
71
+
Future write-capable tools (e.g. a proposed `release_create`) will document their idempotency semantics explicitly in this section.
44
72
45
73
---
46
74
@@ -69,7 +97,8 @@ Payloads are minified (`JSON.stringify`, no pretty-print). `MCP_JSON_FORMAT_VERS
// — on per-repo failure (does not fail the batch)
73
102
}]
74
103
}
75
104
```
@@ -302,7 +331,9 @@ The `attention` array is sorted by urgency: failing CI repos first, then by stal
302
331
-`scripts/versions.env`: shell `KEY=VALUE` lines whose key ends in `_REF`, `_SHA`, or `_VERSION` and whose value is a 40-char hex SHA. These are always reported under `skipped` with `reason: "ambiguous_repo"` because the file does not encode which GitHub repo each key belongs to.
303
332
-`package.json`: `dependencies`/`devDependencies` whose version is a GitHub shorthand (`owner/repo#ref`) or HTTPS GitHub URL.
304
333
305
-
`behindBy: -1` signals an error resolving that pin (e.g. upstream repo not found).
334
+
`behindBy: -1` signals an error resolving that pin. When this happens the pin entry also carries an `error: { code, message, retryable, suggestedFix? }` field explaining why (e.g. `NOT_FOUND`, `RATE_LIMITED`, `UPSTREAM_FAILURE`).
335
+
336
+
`skipped[].reason` remains a free-text parser-level code (`ambiguous_repo`, `ambiguous_ref`, `not_github`, `ls_tree_no_sha`, `ls_tree_failed`) — it describes a pin that couldn't be parsed at all, not a GitHub-side error.
306
337
307
338
---
308
339
@@ -326,7 +357,12 @@ The `attention` array is sorted by urgency: failing CI repos first, then by stal
0 commit comments