@rudderhq/agent-runtime-utils 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rudder-mcp-contract.d.ts +111 -567
- package/dist/rudder-mcp-contract.d.ts.map +1 -1
- package/dist/rudder-mcp-contract.js +435 -232
- package/dist/rudder-mcp-contract.js.map +1 -1
- package/dist/rudder-mcp-preflight.d.ts.map +1 -1
- package/dist/rudder-mcp-preflight.js +10 -1
- package/dist/rudder-mcp-preflight.js.map +1 -1
- package/dist/rudder-mcp-tool-descriptors.generated.d.ts +9 -1
- package/dist/rudder-mcp-tool-descriptors.generated.d.ts.map +1 -1
- package/dist/rudder-mcp-tool-descriptors.generated.js +10 -1
- package/dist/rudder-mcp-tool-descriptors.generated.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import { GENERATED_RUDDER_BROWSER_MCP_CONTRACT_HASH, GENERATED_RUDDER_CORE_MCP_CONTRACT_HASH, RUDDER_MCP_TOOL_DESCRIPTORS, } from "./rudder-mcp-tool-descriptors.generated.js";
|
|
2
2
|
export const RUDDER_MCP_CONTRACT_VERSION = "rudder.agent-mcp-tools/v1";
|
|
3
|
-
function mcpString(description) {
|
|
4
|
-
return { type: "string", description };
|
|
5
|
-
}
|
|
6
|
-
function mcpBoolean(description) {
|
|
7
|
-
return { type: "boolean", description };
|
|
8
|
-
}
|
|
9
|
-
function mcpNumber(description) {
|
|
10
|
-
return { type: "number", description };
|
|
11
|
-
}
|
|
12
|
-
function mcpStringArray(description) {
|
|
13
|
-
return { type: "array", items: { type: "string" }, description };
|
|
14
|
-
}
|
|
15
3
|
function browserMcpInputSchema(id) {
|
|
16
4
|
const string = (description, extra = {}) => ({ type: "string", description, ...extra });
|
|
17
5
|
const number = (description, extra = {}) => ({ type: "number", description, ...extra });
|
|
@@ -173,229 +161,444 @@ function browserMcpInputSchema(id) {
|
|
|
173
161
|
export function rudderMcpInputSchemaForCapability(id) {
|
|
174
162
|
if (id.startsWith("browser."))
|
|
175
163
|
return browserMcpInputSchema(id);
|
|
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
|
-
addString("relatedAgentId", "Agent id filter.");
|
|
202
|
-
addString("status", "Run status filter.");
|
|
203
|
-
addString("runtime", "Runtime type filter.");
|
|
204
|
-
addString("issueId", "Linked issue id filter.");
|
|
205
|
-
addString("createdBefore", "Only runs created before this timestamp.");
|
|
206
|
-
addString("cursor", "Stable summary cursor.");
|
|
207
|
-
addNumber("limit", "Summary page size, capped by the server.");
|
|
208
|
-
break;
|
|
209
|
-
case "runs.events":
|
|
210
|
-
addString("run", "Run id or short run id.");
|
|
211
|
-
addString("cursor", "Opaque total-order event cursor.");
|
|
212
|
-
addNumber("afterSeq", "Legacy sequence-only cursor.");
|
|
213
|
-
addNumber("limit", "Event page size, capped by the server.");
|
|
214
|
-
addNumber("maxChars", "Maximum payload preview characters per event.");
|
|
215
|
-
break;
|
|
216
|
-
case "runs.log":
|
|
217
|
-
addString("run", "Run id or short run id.");
|
|
218
|
-
addNumber("maxChars", "Maximum log characters for display.");
|
|
219
|
-
addNumber("offset", "Byte offset for the ranged read.");
|
|
220
|
-
addNumber("limitBytes", "Maximum bytes for the ranged read.");
|
|
221
|
-
break;
|
|
222
|
-
case "runs.transcript":
|
|
223
|
-
addString("run", "Run id or short run id.");
|
|
224
|
-
addBoolean("errorsOnly", "Return only error rows.");
|
|
225
|
-
addString("aroundError", "Transcript error step id.");
|
|
226
|
-
addNumber("contextTurns", "Turns around the selected error.");
|
|
227
|
-
addString("cursor", "Stable transcript cursor.");
|
|
228
|
-
addNumber("turnLimit", "Maximum turns to return.");
|
|
229
|
-
addBoolean("chronological", "Return oldest-first rows.");
|
|
230
|
-
addBoolean("narrative", "Use narrative row formatting.");
|
|
231
|
-
addNumber("maxChars", "Maximum output characters per row.");
|
|
232
|
-
addBoolean("includeOutput", "Include clipped row output.");
|
|
233
|
-
break;
|
|
234
|
-
case "runs.errors":
|
|
235
|
-
addString("run", "Run id or short run id.");
|
|
236
|
-
addString("cursor", "Error page cursor.");
|
|
237
|
-
addNumber("maxChars", "Maximum output characters per error.");
|
|
238
|
-
break;
|
|
239
|
-
default:
|
|
240
|
-
addString("run", "Run id or short run id.");
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
return { type: "object", additionalProperties: false, properties };
|
|
244
|
-
}
|
|
245
|
-
if (id.startsWith("issue.")) {
|
|
246
|
-
add("issue", mcpString("Issue UUID, identifier, or short reference."));
|
|
247
|
-
add("body", mcpString("Direct Markdown body for issue comments or close-out notes."));
|
|
248
|
-
add("comment", mcpString("Direct Markdown review, blocker, or completion comment."));
|
|
249
|
-
add("images", { type: "array", items: { type: "string" }, description: "Local image paths to attach when supported." });
|
|
250
|
-
}
|
|
251
|
-
if (id.startsWith("project."))
|
|
252
|
-
add("project", mcpString("Project UUID or shortname."));
|
|
253
|
-
if (id.startsWith("library.file.")) {
|
|
254
|
-
add("path", mcpString("Library-relative file or directory path."));
|
|
255
|
-
if (id === "library.file.list") {
|
|
256
|
-
add("directory", mcpString("Library-relative directory path. Defaults to the run's project Library path when available."));
|
|
257
|
-
}
|
|
258
|
-
add("body", mcpString("Direct file content for put operations."));
|
|
259
|
-
}
|
|
260
|
-
if (id.startsWith("approval.")) {
|
|
261
|
-
add("approval", mcpString("Approval UUID or short reference."));
|
|
262
|
-
add("body", mcpString("Direct Markdown approval comment body."));
|
|
263
|
-
}
|
|
264
|
-
if (id.startsWith("skill.")) {
|
|
265
|
-
add("skill", mcpString("Organization skill id."));
|
|
266
|
-
add("path", mcpString("Skill package file path, such as SKILL.md."));
|
|
267
|
-
}
|
|
268
|
-
if (id.startsWith("browser.")) {
|
|
269
|
-
add("url", mcpString("HTTP or HTTPS URL."));
|
|
270
|
-
add("tabId", mcpString("Run-owned Rudder Browser tab id."));
|
|
271
|
-
add("ref", mcpString("Element reference returned by rudder_browser_read."));
|
|
272
|
-
add("text", mcpString("Text to enter into the referenced element."));
|
|
273
|
-
}
|
|
274
|
-
if (id.startsWith("automation.")) {
|
|
275
|
-
add("automation", mcpString("Automation id."));
|
|
276
|
-
add("trigger", mcpString("Automation trigger id."));
|
|
277
|
-
add("payload", { type: ["object", "string"], description: "JSON payload object or JSON string." });
|
|
278
|
-
}
|
|
279
|
-
if (id.startsWith("chat.")) {
|
|
280
|
-
add("chat", mcpString("Chat conversation id."));
|
|
281
|
-
add("body", mcpString("Agent-authored chat message body."));
|
|
282
|
-
}
|
|
283
|
-
if (id.startsWith("agent.skills.")) {
|
|
284
|
-
add("selectionRefs", { type: "array", items: { type: "string" }, description: "Skill selection refs." });
|
|
285
|
-
add("skills", { type: "array", items: { type: "string" }, description: "Skill selection refs alias." });
|
|
286
|
-
add("desiredSkills", mcpString("Comma-separated desired skill refs for sync."));
|
|
287
|
-
}
|
|
288
|
-
for (const [key, description] of Object.entries({
|
|
289
|
-
query: "Search query.",
|
|
290
|
-
decision: "Structured review decision.",
|
|
291
|
-
title: "Title.",
|
|
292
|
-
name: "Name.",
|
|
293
|
-
description: "Description or summary text.",
|
|
294
|
-
status: "Status filter or new status.",
|
|
295
|
-
cursor: "Pagination cursor.",
|
|
296
|
-
source: "Source path or source label.",
|
|
297
|
-
kind: "Trigger kind.",
|
|
298
|
-
label: "Trigger label.",
|
|
299
|
-
skill: "Skill key, id, or display name.",
|
|
300
|
-
slug: "Slug.",
|
|
301
|
-
markdown: "Direct Markdown content.",
|
|
302
|
-
role: "Agent role.",
|
|
303
|
-
capabilities: "Agent capability summary.",
|
|
304
|
-
wakeCommentId: "Issue comment id that triggered the wake.",
|
|
305
|
-
expectedStatuses: "Comma-separated checkout precondition statuses.",
|
|
306
|
-
after: "Pagination anchor or lower bound.",
|
|
307
|
-
order: "Sort order.",
|
|
308
|
-
priority: "Issue or automation priority.",
|
|
309
|
-
assigneeAgentId: "Target assignee agent id or reference.",
|
|
310
|
-
projectId: "Project id or reference.",
|
|
311
|
-
goalId: "Goal id or reference.",
|
|
312
|
-
parentId: "Parent issue id or reference.",
|
|
313
|
-
parentIssueId: "Parent issue id or reference.",
|
|
314
|
-
requestDepth: "Requested issue depth.",
|
|
315
|
-
billingCode: "Billing code.",
|
|
316
|
-
hiddenAt: "Hidden timestamp.",
|
|
317
|
-
archivedAt: "Archived timestamp.",
|
|
318
|
-
targetDate: "Target date.",
|
|
319
|
-
color: "Display color.",
|
|
320
|
-
scope: "Search or visibility scope.",
|
|
321
|
-
sha: "Git commit SHA.",
|
|
322
|
-
message: "Commit or status message.",
|
|
323
|
-
branch: "Git branch name.",
|
|
324
|
-
repoPath: "Repository path.",
|
|
325
|
-
workspacePath: "Workspace path.",
|
|
326
|
-
relatedAgentId: "Agent id used as a filter or related principal.",
|
|
327
|
-
leadAgentId: "Lead agent id or reference.",
|
|
328
|
-
approvalId: "Approval id or short approval id alias.",
|
|
329
|
-
automationId: "Automation id alias.",
|
|
330
|
-
chatId: "Chat conversation id alias.",
|
|
331
|
-
commentId: "Issue comment id alias.",
|
|
332
|
-
skillId: "Skill id alias.",
|
|
333
|
-
user: "User id, reference, or self.",
|
|
334
|
-
since: "Activity start timestamp.",
|
|
335
|
-
until: "Activity end timestamp.",
|
|
336
|
-
include: "Comma-separated optional data sections.",
|
|
337
|
-
content: "Direct content alias for body.",
|
|
338
|
-
roots: "Comma-separated local roots.",
|
|
339
|
-
projectIds: "Comma-separated project ids.",
|
|
340
|
-
workspaceIds: "Comma-separated workspace ids.",
|
|
341
|
-
cronExpression: "Cron expression.",
|
|
342
|
-
timezone: "Timezone.",
|
|
343
|
-
signingMode: "Webhook signing mode.",
|
|
344
|
-
replayWindowSec: "Webhook replay window in seconds.",
|
|
345
|
-
instructions: "Automation instructions.",
|
|
346
|
-
outputMode: "Automation output mode.",
|
|
347
|
-
concurrencyPolicy: "Automation concurrency policy.",
|
|
348
|
-
catchUpPolicy: "Automation catch-up policy.",
|
|
349
|
-
triggerId: "Automation trigger id.",
|
|
350
|
-
idempotencyKey: "Idempotency key.",
|
|
351
|
-
summary: "Chat summary.",
|
|
352
|
-
preferredAgentId: "Preferred responding agent id or reference.",
|
|
353
|
-
issueCreationMode: "Chat issue creation mode.",
|
|
354
|
-
editUserMessageId: "User message id to edit.",
|
|
355
|
-
updatedAfter: "Run updated-after timestamp.",
|
|
356
|
-
runIdPrefix: "Run id prefix filter.",
|
|
357
|
-
runtime: "Runtime type filter.",
|
|
358
|
-
issueId: "Issue id filter.",
|
|
359
|
-
usedSkill: "Used skill filter.",
|
|
360
|
-
loadedSkill: "Loaded skill filter.",
|
|
361
|
-
createdBefore: "Created-before timestamp.",
|
|
362
|
-
evidence: "Skill evidence type.",
|
|
363
|
-
aroundError: "Transcript error step id.",
|
|
364
|
-
maxOutputChars: "Maximum output characters.",
|
|
365
|
-
})) {
|
|
366
|
-
add(key, mcpString(description));
|
|
367
|
-
}
|
|
368
|
-
for (const [key, description] of Object.entries({
|
|
369
|
-
limit: "Page size or result limit.",
|
|
370
|
-
count: "Count represented by a report.",
|
|
371
|
-
turnLimit: "Maximum turns to return.",
|
|
372
|
-
contextTurns: "Number of context turns.",
|
|
373
|
-
maxChars: "Maximum characters.",
|
|
374
|
-
snippetChars: "Maximum snippet characters.",
|
|
375
|
-
afterSeq: "Return events after this sequence number.",
|
|
376
|
-
offset: "Byte offset for ranged reads.",
|
|
377
|
-
limitBytes: "Maximum bytes for ranged reads.",
|
|
378
|
-
})) {
|
|
379
|
-
add(key, mcpNumber(description));
|
|
380
|
-
}
|
|
381
|
-
for (const [key, description] of Object.entries({
|
|
382
|
-
selectionRefs: "Skill selection refs.",
|
|
383
|
-
selections: "Skill selection refs alias.",
|
|
384
|
-
skills: "Skill selection refs alias.",
|
|
385
|
-
images: "Local image paths to attach when supported.",
|
|
386
|
-
goalIds: "Goal ids.",
|
|
387
|
-
})) {
|
|
388
|
-
add(key, mcpStringArray(description));
|
|
389
|
-
}
|
|
390
|
-
for (const key of ["clearTitle", "clearCapabilities", "clearDescription", "clearReportsTo", "enable", "enabled", "disabled", "reopen", "planMode", "includeTranscript", "includeOutput", "includeOutputs", "notifyOnIssueCreated", "errorsOnly", "chronological", "narrative", "submit", "full"]) {
|
|
391
|
-
add(key, mcpBoolean(`Boolean option ${key}.`));
|
|
392
|
-
}
|
|
393
|
-
return {
|
|
164
|
+
return coreMcpInputSchema(id);
|
|
165
|
+
}
|
|
166
|
+
function coreMcpInputSchema(id) {
|
|
167
|
+
const string = (description, extra = {}) => ({
|
|
168
|
+
type: "string",
|
|
169
|
+
description,
|
|
170
|
+
minLength: 1,
|
|
171
|
+
maxLength: 100_000,
|
|
172
|
+
...extra,
|
|
173
|
+
});
|
|
174
|
+
const number = (description, minimum = 0, maximum = 10_000) => ({
|
|
175
|
+
type: "number",
|
|
176
|
+
description,
|
|
177
|
+
minimum,
|
|
178
|
+
maximum,
|
|
179
|
+
});
|
|
180
|
+
const boolean = (description) => ({ type: "boolean", description });
|
|
181
|
+
const strings = (description, maxItems = 100) => ({
|
|
182
|
+
type: "array",
|
|
183
|
+
description,
|
|
184
|
+
maxItems,
|
|
185
|
+
items: string(description, { maxLength: 8_192 }),
|
|
186
|
+
});
|
|
187
|
+
const payload = { type: ["object", "string"], description: "JSON payload object or JSON string." };
|
|
188
|
+
const schema = (properties, required = []) => ({
|
|
394
189
|
type: "object",
|
|
395
190
|
additionalProperties: false,
|
|
396
191
|
properties,
|
|
397
|
-
...(
|
|
398
|
-
};
|
|
192
|
+
...(required.length > 0 ? { required } : {}),
|
|
193
|
+
});
|
|
194
|
+
const issue = string("Issue UUID, identifier, or short reference.", { maxLength: 200 });
|
|
195
|
+
const project = string("Project UUID or shortname.", { maxLength: 200 });
|
|
196
|
+
const approval = string("Approval UUID or short reference.", { maxLength: 200 });
|
|
197
|
+
const automation = string("Automation UUID or short reference.", { maxLength: 200 });
|
|
198
|
+
const trigger = string("Automation trigger UUID or short reference.", { maxLength: 200 });
|
|
199
|
+
const chat = string("Chat conversation UUID or short reference.", { maxLength: 200 });
|
|
200
|
+
const run = string("Run UUID or short reference.", { maxLength: 200 });
|
|
201
|
+
const cursor = string("Opaque pagination cursor.", { maxLength: 2_000 });
|
|
202
|
+
const body = string("Direct Markdown body.", { maxLength: 500_000 });
|
|
203
|
+
const images = strings("Local image paths to attach.", 20);
|
|
204
|
+
switch (id) {
|
|
205
|
+
case "agent.me":
|
|
206
|
+
case "agent.inbox":
|
|
207
|
+
case "agent.capabilities":
|
|
208
|
+
case "project.list":
|
|
209
|
+
case "skill.list":
|
|
210
|
+
return schema({});
|
|
211
|
+
case "agent.update":
|
|
212
|
+
return schema({
|
|
213
|
+
name: string("Agent name.", { maxLength: 200 }),
|
|
214
|
+
role: string("Agent role.", { maxLength: 100 }),
|
|
215
|
+
title: string("Agent title.", { maxLength: 300 }),
|
|
216
|
+
capabilities: string("Agent capability summary."),
|
|
217
|
+
description: string("Compatibility alias for capabilities."),
|
|
218
|
+
clearTitle: boolean("Clear the current title."),
|
|
219
|
+
clearCapabilities: boolean("Clear the current capability summary."),
|
|
220
|
+
clearDescription: boolean("Compatibility alias for clearCapabilities."),
|
|
221
|
+
});
|
|
222
|
+
case "agent.skills.create":
|
|
223
|
+
return schema({
|
|
224
|
+
name: string("Skill display name.", { maxLength: 200 }),
|
|
225
|
+
slug: string("Skill slug.", { maxLength: 200 }),
|
|
226
|
+
description: string("Skill description."),
|
|
227
|
+
markdown: string("SKILL.md content.", { maxLength: 500_000 }),
|
|
228
|
+
body: string("Compatibility alias for markdown.", { maxLength: 500_000 }),
|
|
229
|
+
enable: boolean("Enable the created skill for the runtime agent."),
|
|
230
|
+
}, ["name"]);
|
|
231
|
+
case "agent.skills.enable":
|
|
232
|
+
return schema({ selectionRefs: strings("Skill selection references.", 100) }, ["selectionRefs"]);
|
|
233
|
+
case "agent.skills.sync":
|
|
234
|
+
return schema({ desiredSkills: string("Comma-separated desired skill references.", { maxLength: 20_000 }) }, ["desiredSkills"]);
|
|
235
|
+
case "issue.list":
|
|
236
|
+
return schema({
|
|
237
|
+
status: string("Comma-separated issue statuses.", { maxLength: 500 }),
|
|
238
|
+
assigneeAgentId: string("Assignee agent id or reference.", { maxLength: 200 }),
|
|
239
|
+
projectId: string("Project id or reference.", { maxLength: 200 }),
|
|
240
|
+
});
|
|
241
|
+
case "issue.get":
|
|
242
|
+
return schema({ issue }, ["issue"]);
|
|
243
|
+
case "issue.search":
|
|
244
|
+
return schema({
|
|
245
|
+
query: string("Non-empty server-side issue search query.", { maxLength: 2_000 }),
|
|
246
|
+
status: string("Comma-separated issue statuses.", { maxLength: 500 }),
|
|
247
|
+
assigneeAgentId: string("Assignee agent id or reference.", { maxLength: 200 }),
|
|
248
|
+
projectId: string("Project id or reference.", { maxLength: 200 }),
|
|
249
|
+
}, ["query"]);
|
|
250
|
+
case "issue.context":
|
|
251
|
+
return schema({ issue, wakeCommentId: string("Wake comment id or short reference.", { maxLength: 200 }) }, ["issue"]);
|
|
252
|
+
case "issue.checkout":
|
|
253
|
+
return schema({ issue, expectedStatuses: string("Comma-separated allowed prior statuses.", { maxLength: 500 }) }, ["issue"]);
|
|
254
|
+
case "issue.comment":
|
|
255
|
+
return {
|
|
256
|
+
...schema({ issue, body, comment: body, images, reopen: boolean("Reopen the issue while commenting.") }, ["issue"]),
|
|
257
|
+
anyOf: [{ required: ["body"] }, { required: ["comment"] }],
|
|
258
|
+
};
|
|
259
|
+
case "issue.comments.list":
|
|
260
|
+
return schema({
|
|
261
|
+
issue,
|
|
262
|
+
after: string("Return comments after this comment id or short reference.", { maxLength: 200 }),
|
|
263
|
+
order: string("Comment order.", { enum: ["asc", "desc"], maxLength: 10 }),
|
|
264
|
+
}, ["issue"]);
|
|
265
|
+
case "issue.comments.get":
|
|
266
|
+
return schema({ issue, comment: string("Comment id or short reference.", { maxLength: 200 }) }, ["issue", "comment"]);
|
|
267
|
+
case "issue.update":
|
|
268
|
+
return schema({
|
|
269
|
+
issue,
|
|
270
|
+
title: string("Issue title.", { maxLength: 500 }),
|
|
271
|
+
description: string("Issue description.", { maxLength: 500_000 }),
|
|
272
|
+
status: string("New issue status.", { maxLength: 100 }),
|
|
273
|
+
priority: string("New issue priority.", { maxLength: 100 }),
|
|
274
|
+
assigneeAgentId: string("Assignee agent id or reference.", { maxLength: 200 }),
|
|
275
|
+
projectId: string("Project id or reference.", { maxLength: 200 }),
|
|
276
|
+
goalId: string("Goal id or reference.", { maxLength: 200 }),
|
|
277
|
+
parentId: string("Parent issue id or reference.", { maxLength: 200 }),
|
|
278
|
+
requestDepth: string("Requested issue depth.", { maxLength: 30 }),
|
|
279
|
+
billingCode: string("Billing code.", { maxLength: 200 }),
|
|
280
|
+
hiddenAt: string("Hidden timestamp.", { maxLength: 100 }),
|
|
281
|
+
comment: body,
|
|
282
|
+
body,
|
|
283
|
+
images,
|
|
284
|
+
}, ["issue"]);
|
|
285
|
+
case "issue.review":
|
|
286
|
+
return {
|
|
287
|
+
...schema({
|
|
288
|
+
issue,
|
|
289
|
+
decision: string("Structured review decision.", { enum: ["approve", "request_changes", "needs_followup", "blocked"], maxLength: 30 }),
|
|
290
|
+
comment: body,
|
|
291
|
+
body,
|
|
292
|
+
}, ["issue", "decision"]),
|
|
293
|
+
anyOf: [{ required: ["comment"] }, { required: ["body"] }],
|
|
294
|
+
};
|
|
295
|
+
case "issue.commit":
|
|
296
|
+
return schema({
|
|
297
|
+
issue,
|
|
298
|
+
sha: string("Git commit SHA.", { maxLength: 100 }),
|
|
299
|
+
message: string("Commit subject or status message.", { maxLength: 2_000 }),
|
|
300
|
+
branch: string("Git branch name.", { maxLength: 500 }),
|
|
301
|
+
repoPath: string("Repository path.", { maxLength: 8_192 }),
|
|
302
|
+
workspacePath: string("Workspace path.", { maxLength: 8_192 }),
|
|
303
|
+
count: number("Number of commits represented.", 1, 10_000),
|
|
304
|
+
}, ["issue", "sha", "message"]);
|
|
305
|
+
case "issue.done":
|
|
306
|
+
case "issue.block":
|
|
307
|
+
return {
|
|
308
|
+
...schema({ issue, comment: body, body, images }, ["issue"]),
|
|
309
|
+
anyOf: [{ required: ["comment"] }, { required: ["body"] }],
|
|
310
|
+
};
|
|
311
|
+
case "project.get":
|
|
312
|
+
return schema({ project }, ["project"]);
|
|
313
|
+
case "project.create":
|
|
314
|
+
return schema({
|
|
315
|
+
name: string("Project name.", { maxLength: 300 }),
|
|
316
|
+
description: string("Project description.", { maxLength: 500_000 }),
|
|
317
|
+
status: string("Project status.", { maxLength: 100 }),
|
|
318
|
+
goalId: string("Goal id or reference.", { maxLength: 200 }),
|
|
319
|
+
goalIds: strings("Goal ids.", 100),
|
|
320
|
+
leadAgentId: string("Lead agent id or reference.", { maxLength: 200 }),
|
|
321
|
+
targetDate: string("Target date.", { maxLength: 100 }),
|
|
322
|
+
color: string("Display color.", { maxLength: 100 }),
|
|
323
|
+
}, ["name"]);
|
|
324
|
+
case "project.update":
|
|
325
|
+
return schema({
|
|
326
|
+
project,
|
|
327
|
+
name: string("Project name.", { maxLength: 300 }),
|
|
328
|
+
description: string("Project description.", { maxLength: 500_000 }),
|
|
329
|
+
status: string("Project status.", { maxLength: 100 }),
|
|
330
|
+
goalId: string("Goal id or reference.", { maxLength: 200 }),
|
|
331
|
+
goalIds: strings("Goal ids.", 100),
|
|
332
|
+
leadAgentId: string("Lead agent id or reference.", { maxLength: 200 }),
|
|
333
|
+
targetDate: string("Target date.", { maxLength: 100 }),
|
|
334
|
+
color: string("Display color.", { maxLength: 100 }),
|
|
335
|
+
archivedAt: string("Archive timestamp.", { maxLength: 100 }),
|
|
336
|
+
}, ["project"]);
|
|
337
|
+
case "user.activity":
|
|
338
|
+
return schema({
|
|
339
|
+
user: string("User id, reference, or self.", { maxLength: 200 }),
|
|
340
|
+
since: string("Activity start timestamp.", { maxLength: 100 }),
|
|
341
|
+
until: string("Activity end timestamp.", { maxLength: 100 }),
|
|
342
|
+
include: string("Comma-separated optional sections.", { maxLength: 500 }),
|
|
343
|
+
relatedAgentId: string("Related agent id.", { maxLength: 200 }),
|
|
344
|
+
projectId: string("Project id.", { maxLength: 200 }),
|
|
345
|
+
issueId: string("Issue id.", { maxLength: 200 }),
|
|
346
|
+
limit: number("Page size.", 1, 100),
|
|
347
|
+
cursor,
|
|
348
|
+
});
|
|
349
|
+
case "library.file.list":
|
|
350
|
+
return schema({
|
|
351
|
+
directory: string("Library-relative directory path.", { maxLength: 8_192 }),
|
|
352
|
+
path: string("Compatibility alias for directory.", { maxLength: 8_192 }),
|
|
353
|
+
});
|
|
354
|
+
case "library.file.get":
|
|
355
|
+
case "library.file.ref":
|
|
356
|
+
case "library.file.link":
|
|
357
|
+
return schema({ path: string("Library-relative file path.", { maxLength: 8_192 }) }, ["path"]);
|
|
358
|
+
case "library.file.put":
|
|
359
|
+
return {
|
|
360
|
+
...schema({
|
|
361
|
+
path: string("Library-relative file path.", { maxLength: 8_192 }),
|
|
362
|
+
body: string("Direct file content.", { maxLength: 1_000_000 }),
|
|
363
|
+
content: string("Compatibility alias for body.", { maxLength: 1_000_000 }),
|
|
364
|
+
}, ["path"]),
|
|
365
|
+
anyOf: [{ required: ["body"] }, { required: ["content"] }],
|
|
366
|
+
};
|
|
367
|
+
case "approval.get":
|
|
368
|
+
case "approval.issues":
|
|
369
|
+
return schema({ approval }, ["approval"]);
|
|
370
|
+
case "approval.comment":
|
|
371
|
+
return {
|
|
372
|
+
...schema({ approval, body, comment: body }, ["approval"]),
|
|
373
|
+
anyOf: [{ required: ["body"] }, { required: ["comment"] }],
|
|
374
|
+
};
|
|
375
|
+
case "skill.get":
|
|
376
|
+
return schema({ skill: string("Organization skill id.", { maxLength: 200 }) }, ["skill"]);
|
|
377
|
+
case "skill.file":
|
|
378
|
+
return schema({
|
|
379
|
+
skill: string("Organization skill id.", { maxLength: 200 }),
|
|
380
|
+
path: string("Skill package file path.", { maxLength: 8_192 }),
|
|
381
|
+
}, ["skill"]);
|
|
382
|
+
case "skill.import":
|
|
383
|
+
return schema({ source: string("Local path, URL, or repository reference.", { maxLength: 8_192 }) }, ["source"]);
|
|
384
|
+
case "skill.scan-local":
|
|
385
|
+
return schema({ roots: string("Comma-separated local roots.", { maxLength: 20_000 }) });
|
|
386
|
+
case "skill.scan-projects":
|
|
387
|
+
return schema({
|
|
388
|
+
projectIds: string("Comma-separated project ids.", { maxLength: 20_000 }),
|
|
389
|
+
workspaceIds: string("Comma-separated workspace ids.", { maxLength: 20_000 }),
|
|
390
|
+
});
|
|
391
|
+
case "automation.list":
|
|
392
|
+
return schema({
|
|
393
|
+
status: string("Automation status filter.", { maxLength: 100 }),
|
|
394
|
+
assigneeAgentId: string("Assignee agent id.", { maxLength: 200 }),
|
|
395
|
+
projectId: string("Project id.", { maxLength: 200 }),
|
|
396
|
+
outputMode: string("Output mode filter.", { maxLength: 100 }),
|
|
397
|
+
});
|
|
398
|
+
case "automation.get":
|
|
399
|
+
case "automation.triggers.list":
|
|
400
|
+
case "automation.enable":
|
|
401
|
+
case "automation.disable":
|
|
402
|
+
return schema({ automation }, ["automation"]);
|
|
403
|
+
case "automation.runs":
|
|
404
|
+
return schema({ automation, limit: number("Maximum run rows.", 1, 100) }, ["automation"]);
|
|
405
|
+
case "automation.triggers.create":
|
|
406
|
+
return schema({
|
|
407
|
+
automation,
|
|
408
|
+
payload,
|
|
409
|
+
kind: string("Trigger kind.", { maxLength: 100 }),
|
|
410
|
+
label: string("Trigger label.", { maxLength: 300 }),
|
|
411
|
+
enabled: boolean("Create the trigger enabled."),
|
|
412
|
+
disabled: boolean("Create the trigger disabled."),
|
|
413
|
+
cronExpression: string("Cron expression.", { maxLength: 500 }),
|
|
414
|
+
timezone: string("IANA timezone.", { maxLength: 200 }),
|
|
415
|
+
signingMode: string("Webhook signing mode.", { maxLength: 100 }),
|
|
416
|
+
replayWindowSec: string("Webhook replay window in seconds.", { maxLength: 30 }),
|
|
417
|
+
}, ["automation"]);
|
|
418
|
+
case "automation.triggers.update":
|
|
419
|
+
return schema({
|
|
420
|
+
trigger,
|
|
421
|
+
payload,
|
|
422
|
+
label: string("Trigger label.", { maxLength: 300 }),
|
|
423
|
+
enabled: boolean("Enable the trigger."),
|
|
424
|
+
disabled: boolean("Disable the trigger."),
|
|
425
|
+
cronExpression: string("Cron expression.", { maxLength: 500 }),
|
|
426
|
+
timezone: string("IANA timezone.", { maxLength: 200 }),
|
|
427
|
+
signingMode: string("Webhook signing mode.", { maxLength: 100 }),
|
|
428
|
+
replayWindowSec: string("Webhook replay window in seconds.", { maxLength: 30 }),
|
|
429
|
+
}, ["trigger"]);
|
|
430
|
+
case "automation.triggers.delete":
|
|
431
|
+
case "automation.triggers.rotate-secret":
|
|
432
|
+
return schema({ trigger }, ["trigger"]);
|
|
433
|
+
case "automation.create":
|
|
434
|
+
return schema({
|
|
435
|
+
payload,
|
|
436
|
+
title: string("Automation title.", { maxLength: 500 }),
|
|
437
|
+
instructions: string("Automation instructions.", { maxLength: 500_000 }),
|
|
438
|
+
description: string("Compatibility alias for instructions.", { maxLength: 500_000 }),
|
|
439
|
+
assigneeAgentId: string("Assignee agent id.", { maxLength: 200 }),
|
|
440
|
+
projectId: string("Project id.", { maxLength: 200 }),
|
|
441
|
+
goalId: string("Goal id.", { maxLength: 200 }),
|
|
442
|
+
parentIssueId: string("Parent issue id.", { maxLength: 200 }),
|
|
443
|
+
priority: string("Issue priority.", { maxLength: 100 }),
|
|
444
|
+
status: string("Automation status.", { maxLength: 100 }),
|
|
445
|
+
outputMode: string("Automation output mode.", { maxLength: 100 }),
|
|
446
|
+
concurrencyPolicy: string("Concurrency policy.", { maxLength: 100 }),
|
|
447
|
+
catchUpPolicy: string("Catch-up policy.", { maxLength: 100 }),
|
|
448
|
+
notifyOnIssueCreated: boolean("Notify when an issue is created."),
|
|
449
|
+
});
|
|
450
|
+
case "automation.update":
|
|
451
|
+
return schema({
|
|
452
|
+
automation,
|
|
453
|
+
payload,
|
|
454
|
+
title: string("Automation title.", { maxLength: 500 }),
|
|
455
|
+
instructions: string("Automation instructions.", { maxLength: 500_000 }),
|
|
456
|
+
description: string("Compatibility alias for instructions.", { maxLength: 500_000 }),
|
|
457
|
+
assigneeAgentId: string("Assignee agent id.", { maxLength: 200 }),
|
|
458
|
+
projectId: string("Project id.", { maxLength: 200 }),
|
|
459
|
+
goalId: string("Goal id.", { maxLength: 200 }),
|
|
460
|
+
parentIssueId: string("Parent issue id.", { maxLength: 200 }),
|
|
461
|
+
priority: string("Issue priority.", { maxLength: 100 }),
|
|
462
|
+
status: string("Automation status.", { maxLength: 100 }),
|
|
463
|
+
outputMode: string("Automation output mode.", { maxLength: 100 }),
|
|
464
|
+
concurrencyPolicy: string("Concurrency policy.", { maxLength: 100 }),
|
|
465
|
+
catchUpPolicy: string("Catch-up policy.", { maxLength: 100 }),
|
|
466
|
+
notifyOnIssueCreated: boolean("Notify when an issue is created."),
|
|
467
|
+
}, ["automation"]);
|
|
468
|
+
case "automation.run":
|
|
469
|
+
return schema({
|
|
470
|
+
automation,
|
|
471
|
+
triggerId: string("Trigger id.", { maxLength: 200 }),
|
|
472
|
+
payload,
|
|
473
|
+
idempotencyKey: string("Idempotency key.", { maxLength: 500 }),
|
|
474
|
+
source: string("Invocation source.", { maxLength: 500 }),
|
|
475
|
+
}, ["automation"]);
|
|
476
|
+
case "chat.list":
|
|
477
|
+
return schema({
|
|
478
|
+
status: string("Chat status filter.", { maxLength: 100 }),
|
|
479
|
+
query: string("Optional chat query.", { maxLength: 2_000 }),
|
|
480
|
+
limit: number("Maximum chat rows.", 1, 100),
|
|
481
|
+
});
|
|
482
|
+
case "chat.search":
|
|
483
|
+
return schema({
|
|
484
|
+
query: string("Non-empty chat search query.", { maxLength: 2_000 }),
|
|
485
|
+
status: string("Chat status filter.", { maxLength: 100 }),
|
|
486
|
+
scope: string("Search scope.", { maxLength: 100 }),
|
|
487
|
+
limit: number("Maximum matches.", 1, 100),
|
|
488
|
+
snippetChars: number("Maximum snippet characters.", 100, 10_000),
|
|
489
|
+
}, ["query"]);
|
|
490
|
+
case "chat.get":
|
|
491
|
+
case "chat.archive":
|
|
492
|
+
return schema({ chat }, ["chat"]);
|
|
493
|
+
case "chat.messages":
|
|
494
|
+
return schema({
|
|
495
|
+
chat,
|
|
496
|
+
limit: number("Maximum message rows.", 1, 100),
|
|
497
|
+
cursor,
|
|
498
|
+
maxOutputChars: number("Maximum output characters per row.", 100, 20_000),
|
|
499
|
+
includeTranscript: boolean("Include bounded transcript data."),
|
|
500
|
+
includeOutput: boolean("Compatibility alias for includeTranscript."),
|
|
501
|
+
}, ["chat"]);
|
|
502
|
+
case "chat.transcript":
|
|
503
|
+
return schema({
|
|
504
|
+
chat,
|
|
505
|
+
limit: number("Maximum transcript rows.", 1, 100),
|
|
506
|
+
cursor,
|
|
507
|
+
maxOutputChars: number("Maximum output characters per row.", 100, 20_000),
|
|
508
|
+
}, ["chat"]);
|
|
509
|
+
case "chat.read":
|
|
510
|
+
return schema({
|
|
511
|
+
chat,
|
|
512
|
+
limit: number("Maximum message rows.", 1, 100),
|
|
513
|
+
turnLimit: number("Maximum transcript turns.", 1, 100),
|
|
514
|
+
cursor,
|
|
515
|
+
maxOutputChars: number("Maximum output characters per row.", 100, 20_000),
|
|
516
|
+
includeTranscript: boolean("Include bounded transcript data."),
|
|
517
|
+
includeOutput: boolean("Compatibility alias for includeTranscript."),
|
|
518
|
+
}, ["chat"]);
|
|
519
|
+
case "chat.create":
|
|
520
|
+
return schema({
|
|
521
|
+
body: string("Initial agent-authored chat message.", { maxLength: 500_000 }),
|
|
522
|
+
payload,
|
|
523
|
+
title: string("Chat title.", { maxLength: 500 }),
|
|
524
|
+
summary: string("Chat summary.", { maxLength: 10_000 }),
|
|
525
|
+
preferredAgentId: string("Preferred responding agent id.", { maxLength: 200 }),
|
|
526
|
+
issueCreationMode: string("Issue creation mode.", { maxLength: 100 }),
|
|
527
|
+
planMode: boolean("Start the chat in plan mode."),
|
|
528
|
+
}, ["body"]);
|
|
529
|
+
case "chat.send":
|
|
530
|
+
return schema({
|
|
531
|
+
chat,
|
|
532
|
+
body: string("Agent-authored chat message.", { maxLength: 500_000 }),
|
|
533
|
+
editUserMessageId: string("User message id to edit.", { maxLength: 200 }),
|
|
534
|
+
}, ["chat", "body"]);
|
|
535
|
+
case "runs.list":
|
|
536
|
+
return schema({
|
|
537
|
+
updatedAfter: string("Only runs updated after this timestamp.", { maxLength: 100 }),
|
|
538
|
+
runIdPrefix: string("Run id prefix filter.", { maxLength: 200 }),
|
|
539
|
+
relatedAgentId: string("Agent id filter.", { maxLength: 200 }),
|
|
540
|
+
status: string("Run status filter.", { maxLength: 100 }),
|
|
541
|
+
runtime: string("Runtime type filter.", { maxLength: 100 }),
|
|
542
|
+
issueId: string("Linked issue id filter.", { maxLength: 200 }),
|
|
543
|
+
usedSkill: string("Used skill filter.", { maxLength: 500 }),
|
|
544
|
+
loadedSkill: string("Loaded skill filter.", { maxLength: 500 }),
|
|
545
|
+
createdBefore: string("Only runs created before this timestamp.", { maxLength: 100 }),
|
|
546
|
+
cursor,
|
|
547
|
+
limit: number("Summary page size.", 1, 100),
|
|
548
|
+
});
|
|
549
|
+
case "runs.by-skill":
|
|
550
|
+
return schema({
|
|
551
|
+
skill: string("Skill key or display name.", { maxLength: 500 }),
|
|
552
|
+
evidence: string("Skill evidence type.", { enum: ["used", "loaded"], maxLength: 20 }),
|
|
553
|
+
relatedAgentId: string("Agent id filter.", { maxLength: 200 }),
|
|
554
|
+
status: string("Run status filter.", { maxLength: 100 }),
|
|
555
|
+
runtime: string("Runtime type filter.", { maxLength: 100 }),
|
|
556
|
+
issueId: string("Linked issue id filter.", { maxLength: 200 }),
|
|
557
|
+
createdBefore: string("Only runs created before this timestamp.", { maxLength: 100 }),
|
|
558
|
+
cursor,
|
|
559
|
+
limit: number("Summary page size.", 1, 100),
|
|
560
|
+
}, ["skill"]);
|
|
561
|
+
case "runs.get":
|
|
562
|
+
case "runs.cancel":
|
|
563
|
+
case "runs.retry":
|
|
564
|
+
return schema({ run }, ["run"]);
|
|
565
|
+
case "runs.events":
|
|
566
|
+
return schema({
|
|
567
|
+
run,
|
|
568
|
+
cursor,
|
|
569
|
+
afterSeq: number("Legacy sequence-only cursor.", 0, 10_000_000),
|
|
570
|
+
limit: number("Event page size.", 1, 500),
|
|
571
|
+
maxChars: number("Maximum preview characters per event.", 100, 20_000),
|
|
572
|
+
}, ["run"]);
|
|
573
|
+
case "runs.log":
|
|
574
|
+
return schema({
|
|
575
|
+
run,
|
|
576
|
+
maxChars: number("Maximum displayed log characters.", 100, 100_000),
|
|
577
|
+
offset: number("Byte offset for ranged read.", 0, 1_000_000_000),
|
|
578
|
+
limitBytes: number("Maximum bytes for ranged read.", 1, 1_000_000),
|
|
579
|
+
}, ["run"]);
|
|
580
|
+
case "runs.transcript":
|
|
581
|
+
return schema({
|
|
582
|
+
run,
|
|
583
|
+
errorsOnly: boolean("Return only error rows."),
|
|
584
|
+
aroundError: string("Transcript error step id.", { maxLength: 200 }),
|
|
585
|
+
contextTurns: number("Turns around the selected error.", 1, 20),
|
|
586
|
+
cursor,
|
|
587
|
+
turnLimit: number("Maximum turns.", 1, 100),
|
|
588
|
+
chronological: boolean("Return oldest-first rows."),
|
|
589
|
+
narrative: boolean("Use narrative row formatting."),
|
|
590
|
+
maxChars: number("Maximum output characters per row.", 100, 20_000),
|
|
591
|
+
includeOutput: boolean("Include clipped row output."),
|
|
592
|
+
}, ["run"]);
|
|
593
|
+
case "runs.errors":
|
|
594
|
+
return schema({
|
|
595
|
+
run,
|
|
596
|
+
cursor,
|
|
597
|
+
maxChars: number("Maximum output characters per error.", 100, 20_000),
|
|
598
|
+
}, ["run"]);
|
|
599
|
+
default:
|
|
600
|
+
throw new Error(`Missing exact Rudder MCP input schema for capability: ${id}`);
|
|
601
|
+
}
|
|
399
602
|
}
|
|
400
603
|
export const RUDDER_MCP_CANONICAL_TOOL_DEFINITIONS = RUDDER_MCP_TOOL_DESCRIPTORS.map((tool) => ({
|
|
401
604
|
...tool,
|