execute_workflow
Run predefined workflows by providing the workflow ID and necessary input values to automate tasks within Folderr's API management system.
Instructions
Execute a workflow with the required inputs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inputs | Yes | Input values required by the workflow | |
| workflow_id | Yes | ID of the workflow |
Implementation Reference
- src/index.ts:442-471 (handler)The core handler function that implements the 'execute_workflow' tool logic. It authenticates, POSTs inputs to the Folderr API workflow endpoint, and returns the JSON response or formatted error.private async handleExecuteWorkflow(args: any) { if (!this.config.token) { throw new McpError(ErrorCode.InvalidRequest, 'Not logged in'); } try { const response = await this.axiosInstance.post( `/api/workflows/api-client/${args.workflow_id}`, args.inputs ); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Failed to execute workflow: ${error.response?.data?.message || error.message}`, }, ], isError: true, }; } }
- src/index.ts:193-211 (schema)The tool specification including name, description, and input schema (JSON Schema) for 'execute_workflow', provided in the ListTools response.{ name: 'execute_workflow', description: 'Execute a workflow with the required inputs', inputSchema: { type: 'object', properties: { workflow_id: { type: 'string', description: 'ID of the workflow', }, inputs: { type: 'object', description: 'Input values required by the workflow', additionalProperties: true, }, }, required: ['workflow_id', 'inputs'], }, },
- src/index.ts:227-230 (registration)The dispatch/registration in the CallToolRequest handler switch statement that routes 'execute_workflow' calls to the handleExecuteWorkflow method.case 'get_workflow_inputs': return await this.handleGetWorkflowInputs(request.params.arguments); case 'execute_workflow': return await this.handleExecuteWorkflow(request.params.arguments);