update-routine
Modify a specific routine by updating its name, description, or steps, while preserving the existing schema. Verify changes with the user before applying updates.
Instructions
Update a routine by name. Factor in the existing schema and update only the portion specified by the user. Always confirm with user that they want to update it. User may supply a name that's not exactly as how it's stored. Use the load-routines tool to get the list of all routines.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Description of the routine. | |
| name | Yes | Exact name of the routine to be updated. | |
| steps | Yes | Steps of the routine. |
Implementation Reference
- src/index.ts:89-103 (handler)The handler function for the "update-routine" MCP tool. It calls the updateRoutine helper to persist the updated routine to the JSON file and returns a success message instructing the user to refresh their MCP tools.async ({ name, description, steps }) => { await updateRoutine({ filename: routineFilename, routine: { name, description, steps }, }) return { content: [ { type: "text", text: `Successfully updated routine ${name}. Always tell user to refresh their MCP tools.` } ] } }
- src/index.ts:78-88 (schema)Zod input schema for the "update-routine" tool, validating the name, description, and array of steps for the routine.{ name: z.string().describe("Exact name of the routine to be updated."), description: z.string().describe("Description of the routine."), 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"), }) ).describe("Steps of the routine."), },
- src/index.ts:75-104 (registration)Registration of the "update-routine" tool on the MCP server, specifying name, description, input schema, and handler function.server.tool( "update-routine", "Update a routine by name. Factor in the existing schema and update only the portion specified by the user. Always confirm with user that they want to update it. User may supply a name that's not exactly as how it's stored. Use the load-routines tool to get the list of all routines.", { name: z.string().describe("Exact name of the routine to be updated."), description: z.string().describe("Description of the routine."), 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"), }) ).describe("Steps of the routine."), }, async ({ name, description, steps }) => { await updateRoutine({ filename: routineFilename, routine: { name, description, steps }, }) return { content: [ { type: "text", text: `Successfully updated routine ${name}. Always tell user to refresh their MCP tools.` } ] } } )