create-routine
Design custom workflows by combining multiple tool actions into reusable routines. Streamline repetitive tasks by defining steps, inputs, and outputs for automated execution.
Instructions
Create a custom routine from recently run actions. Inspect recently run tools
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Description of the tool, provide as much context as possible so that when user calls the tool again the LLM can follow the instruction to complete the task with different set of inputs | |
| name | Yes | Name of the custom tool to be created | |
| steps | Yes |
Implementation Reference
- src/index.ts:40-54 (handler)The handler function that executes the logic for the "create-routine" tool. It calls the createRoutine helper to save the new routine to the JSON file and returns a success message instructing the user to refresh their MCP connection.async ({ name, description, steps }) => { await createRoutine({ filename: routineFilename, routine: { name, description, steps }, }) return { content: [ { type: "text", text: `Successfully created routine "${name}" with ${steps.length} steps. Always tell user to refresh their MCP connection to see the new tool.` } ] } }
- src/index.ts:29-39 (schema)Input schema for the "create-routine" tool, using Zod to validate name, description, and an array of steps (each with description, tool, and params).{ name: z.string().describe("Name of the custom tool to be created"), description: z.string().describe("Description of the tool, provide as much context as possible so that when user calls the tool again the LLM can follow the instruction to complete the task with different set of inputs"), steps: z.array( z.object({ description: z.string().describe("Description of the step to help the LLM understand the purpose of the tool call"), tool: z.string().describe("The tool used with name, input schema used"), params: z.object({}).passthrough().describe("Parameters used to call the tool, based on the context some of these should be swapped out with dynamic values"), }).strict().describe("Each step of the routine is a tool call that will get executed and returned the result to feed into the next step") ), },
- src/index.ts:26-55 (registration)Registration of the "create-routine" MCP tool on the McpServer instance, including name, description, input schema, and handler function.server.tool( "create-routine", "Create a custom routine from recently run actions. Inspect recently run tools ", { name: z.string().describe("Name of the custom tool to be created"), description: z.string().describe("Description of the tool, provide as much context as possible so that when user calls the tool again the LLM can follow the instruction to complete the task with different set of inputs"), steps: z.array( z.object({ description: z.string().describe("Description of the step to help the LLM understand the purpose of the tool call"), tool: z.string().describe("The tool used with name, input schema used"), params: z.object({}).passthrough().describe("Parameters used to call the tool, based on the context some of these should be swapped out with dynamic values"), }).strict().describe("Each step of the routine is a tool call that will get executed and returned the result to feed into the next step") ), }, async ({ name, description, steps }) => { await createRoutine({ filename: routineFilename, routine: { name, description, steps }, }) return { content: [ { type: "text", text: `Successfully created routine "${name}" with ${steps.length} steps. Always tell user to refresh their MCP connection to see the new tool.` } ] } } )