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: packages/cli-v3/src/mcp/config.ts
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,12 @@ export const toolsMetadata = {
46
46
description:
47
47
"Get all tasks in the project. Useful when searching for a task and for looking up a task identifier/slug",
48
48
},
49
+
get_current_worker: {
50
+
name: "get_current_worker",
51
+
title: "Get Current Worker",
52
+
description:
53
+
"Get the current worker for the project. Useful when searching for a task and for looking up a task identifier/slug and payload schema, or looking for the latest version in a specific environment.",
`Current worker for ${input.environment} is ${worker.version} using ${worker.sdkVersion} of the SDK.`,
41
+
];
42
+
43
+
if(worker.tasks.length>0){
44
+
contents.push(`The worker has ${worker.tasks.length} tasks registered:`);
45
+
46
+
for(consttaskofworker.tasks){
47
+
if(task.payloadSchema){
48
+
contents.push(
49
+
`- ${task.slug} in ${task.filePath} (payload schema: ${JSON.stringify(
50
+
task.payloadSchema
51
+
)})`
52
+
);
53
+
}else{
54
+
contents.push(`- ${task.slug} in ${task.filePath}`);
55
+
}
56
+
}
57
+
}else{
58
+
contents.push(`The worker has no tasks registered.`);
59
+
}
28
60
29
-
if(!worker.success){
30
-
returnrespondWithError(worker.error);
61
+
contents.push(`\n`);
62
+
contents.push(`URLs:`);
63
+
contents.push(`- Runs: ${urls.runs}`);
64
+
contents.push(`\n`);
65
+
contents.push(
66
+
`You can use the list_runs tool with the version ${worker.version} to get the list of runs for this worker.`
67
+
);
68
+
69
+
if(
70
+
typeofworker.sdkVersion==="string"&&
71
+
typeofworker.cliVersion==="string"&&
72
+
worker.sdkVersion!==worker.cliVersion
73
+
){
74
+
contents.push(
75
+
`WARNING: The SDK version (${worker.sdkVersion}) is different from the CLI version (${worker.cliVersion}). This might cause issues with the task execution. Make sure to pin the CLI and the SDK versions to ${worker.sdkVersion}.`
0 commit comments