@weldable/mcp
Advanced tools
@@ -15,3 +15,3 @@ export interface Parameter { | ||
| connect_url?: string; | ||
| message?: string; | ||
| message: string; | ||
| tool_name?: string; | ||
@@ -18,0 +18,0 @@ description?: string; |
+3
-45
@@ -86,48 +86,6 @@ #!/usr/bin/env node | ||
| const response = await actAction(intent, Object.keys(args).length > 0 ? args : undefined); | ||
| if (response.status === 'complete') { | ||
| return { | ||
| content: [{ type: 'text', text: JSON.stringify(response.result, null, 2) }], | ||
| }; | ||
| if (response.status === 'error') { | ||
| return { content: [{ type: 'text', text: response.message }], isError: true }; | ||
| } | ||
| if (response.status === 'auth_required') { | ||
| return { | ||
| content: [{ | ||
| type: 'text', | ||
| text: `${response.integration_name} is available but not connected yet.\n\n` + | ||
| `The user can connect it here: ${response.connect_url}\n\n` + | ||
| `Tell the user to connect ${response.integration_name}, then call \`weldable_act\` again with the same request.`, | ||
| }], | ||
| }; | ||
| } | ||
| if (response.status === 'needs_args') { | ||
| const missing = (response.missing ?? []) | ||
| .map((p) => `- ${p.name} (${p.type}, ${p.required ? 'required' : 'optional'}): ${p.description}`) | ||
| .join('\n'); | ||
| const hasRequired = (response.missing ?? []).some((p) => p.required); | ||
| const prompt = hasRequired | ||
| ? `Ask the user for the required details, then call \`weldable_act\` again with intent: "${intent}" and the values in args.` | ||
| : `All parameters are optional. Ask the user if they want to specify any (e.g., filters, limits, date ranges), then call \`weldable_act\` again with intent: "${intent}" and any chosen values in args.`; | ||
| return { | ||
| content: [{ | ||
| type: 'text', | ||
| text: `Found **${response.tool_name}** (${response.integration_name}) — available parameters:\n\n` + | ||
| `${missing}\n\n` + | ||
| prompt, | ||
| }], | ||
| }; | ||
| } | ||
| if (response.status === 'not_found') { | ||
| return { | ||
| content: [{ | ||
| type: 'text', | ||
| text: (response.message ?? 'No matching integration found for that request.') + | ||
| ' Try rephrasing the intent, or call `weldable_act` with intent: "list available integrations" to see what\'s supported.', | ||
| }], | ||
| }; | ||
| } | ||
| // error | ||
| return { | ||
| content: [{ type: 'text', text: `Error: ${response.message}` }], | ||
| isError: true, | ||
| }; | ||
| return { content: [{ type: 'text', text: response.message }] }; | ||
| } | ||
@@ -134,0 +92,0 @@ return { |
+1
-1
| { | ||
| "name": "@weldable/mcp", | ||
| "version": "0.2.1", | ||
| "version": "0.2.2", | ||
| "description": "weldable MCP server — give your AI agent hundreds of tools", | ||
@@ -5,0 +5,0 @@ "type": "module", |
11093
-16.23%194
-17.8%