-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmcp_tools.js
More file actions
240 lines (238 loc) · 7.98 KB
/
Copy pathmcp_tools.js
File metadata and controls
240 lines (238 loc) · 7.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// forge mcp tools — the MCP tool REGISTRY as pure data (name/description/schema).
// Handlers stay in cortex_mcp.js (dispatch by name); keeping the registry data-only
// lets docs_check.js reconcile documented tools against it without importing the
// server (which imports doctor.js — that import cycle cost every doctor run the
// whole tool tree's startup and was one require-order bug away from breaking).
export const TOOLS = [
{
name: "cortex_lessons",
description:
"Lessons Forge Cortex learned from past mistakes on THIS repo, for the given files/symbols. Background context — verify before acting, don't blindly obey.",
inputSchema: {
type: "object",
properties: {
files: {
type: "array",
items: { type: "string" },
description: "file paths in play",
},
symbols: {
type: "array",
items: { type: "string" },
description: "symbol names in play",
},
},
},
},
{
name: "cortex_status",
description: "Summary of learned lessons on this repo (counts by state, top by confidence).",
inputSchema: { type: "object", properties: {} },
},
{
name: "preflight_check",
description:
"BEFORE starting a task, check what it names that the repo doesn't define — the things you'd otherwise ASSUME. Returns a clarify list or an all-clear. Ask instead of assuming.",
inputSchema: {
type: "object",
properties: { task: { type: "string", description: "the task/prompt" } },
required: ["task"],
},
},
{
name: "route_task",
description:
"Recommend the cheapest CAPABLE model for a task by code-task complexity (files, fan-out, churn, past mistakes, ambiguity). Advisory — don't burn a top model on a trivial task.",
inputSchema: {
type: "object",
properties: { task: { type: "string" } },
required: ["task"],
},
},
{
name: "assumption_gate",
description:
"Score specification completeness before work starts. Returns shouldAsk, risk, missing dimensions, and concrete questions.",
inputSchema: {
type: "object",
properties: { task: { type: "string", description: "the task/prompt" } },
required: ["task"],
},
},
{
name: "predict_impact",
description:
"Predict blast radius for a symbol or file using Forge atlas reverse-dependency traversal.",
inputSchema: {
type: "object",
properties: {
target: {
type: "string",
description: "symbol name, qualified name, or file",
},
threshold: {
type: "number",
description: "confidence threshold, default 0.1",
},
},
required: ["target"],
},
},
{
name: "substrate_check",
description:
"Full Forge cognitive-substrate pre-action check: assumption gate, route, impact, scope, memory, minimality, and verification checklist.",
inputSchema: {
type: "object",
properties: { task: { type: "string", description: "the task/prompt" } },
required: ["task"],
},
},
{
name: "scope_files",
description:
"Decompose files into INDEPENDENT clusters (run as separate sessions) vs coupled, and surface coupled files you didn't name (the 'forgot the related module' guard).",
inputSchema: {
type: "object",
properties: { files: { type: "array", items: { type: "string" } } },
required: ["files"],
},
},
{
name: "forge_cost",
description:
"Cost report — measured stage factors (gate, cache, route, context) from .forge/metrics.jsonl with multiplicative composition.",
inputSchema: { type: "object", properties: {} },
},
{
name: "forge_dash_data",
description:
"Dashboard JSON payload — ledger stats, metrics, atlas info. Same data forge dash serves at /api/data.",
inputSchema: { type: "object", properties: {} },
},
{
name: "forge_dash_summary",
description:
"Lightweight dashboard health check — just counts (claims, tombstoned, contested, atlas built, metric events). Cheaper than forge_dash_data.",
inputSchema: { type: "object", properties: {} },
},
{
name: "forge_brain",
description: "Project memory index — list all remembered facts stored in .forge/brain/.",
inputSchema: { type: "object", properties: {} },
},
{
name: "forge_ledger_query",
description:
"Query the proof-carrying memory ledger with a natural language query. Returns ranked matching claims.",
inputSchema: {
type: "object",
properties: {
query: {
type: "string",
description: "what you are about to do or looking for",
},
},
required: ["query"],
},
},
{
name: "forge_diagnose",
description:
"Doom-loop check — record a failure and check if the same signature has recurred (3x = escalation). Prevents thrashing.",
inputSchema: {
type: "object",
properties: {
errorText: { type: "string", description: "the error message" },
file: { type: "string", description: "file where the error occurred" },
symbol: { type: "string", description: "symbol involved" },
},
required: ["errorText"],
},
},
{
name: "forge_doctor",
description:
"Health check — verify installed tools, guards, MCP auth, config drift, and system state.",
inputSchema: { type: "object", properties: {} },
},
{
name: "forge_provider_status",
description:
"Provider detection — which API provider is active (auto-detected or configured), env vars set, and health checks.",
inputSchema: { type: "object", properties: {} },
},
{
name: "forge_remember",
description:
"Store a durable fact in this repo's portable memory (.forge/brain/). Use for non-obvious, lasting knowledge (env quirks, decisions, gotchas).",
inputSchema: {
type: "object",
properties: {
name: {
type: "string",
description: "short slug for the fact (used as filename)",
},
body: { type: "string", description: "the fact content (markdown)" },
},
required: ["name", "body"],
},
},
{
name: "forge_ledger_ratify",
description:
"Promote a ledger claim's confidence — record an independent oracle ratification (the claim held under test).",
inputSchema: {
type: "object",
properties: {
id: { type: "string", description: "claim ID or unique prefix" },
},
required: ["id"],
},
},
{
name: "collide_check",
description:
"Parallel-session conflict radar — which recent teammate/agent sessions touched the files (or their import neighbors) you are about to edit, from the team-merged Forge ledger. Advisory: coordinate before editing high-risk files.",
inputSchema: {
type: "object",
properties: {
files: {
type: "array",
items: { type: "string" },
description: "files in play (default: the working diff)",
},
},
},
},
{
name: "rank_code",
description:
"Which code is load-bearing and dangerous to touch — PageRank centrality over the Forge atlas graph joined with past-incident history from the evidence ledger, plus circular-dependency clusters and chokepoint files whose removal disconnects the import graph.",
inputSchema: {
type: "object",
properties: {
top: {
type: "number",
description: "how many files/symbols to return (default 15)",
},
},
},
},
{
name: "forge_ledger_retract",
description:
"Tombstone a ledger claim with a reason — mark it as no longer valid so it stops influencing routing and memory.",
inputSchema: {
type: "object",
properties: {
id: { type: "string", description: "claim ID or unique prefix" },
reason: {
type: "string",
description: "why the claim is being retracted",
},
},
required: ["id", "reason"],
},
},
];