Skip to main content
Glama

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
NameRequiredDescriptionDefault
descriptionYesDescription of the routine.
nameYesExact name of the routine to be updated.
stepsYesSteps of the routine.

Implementation Reference

  • 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.`
          }
        ]
      }
    }
  • 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.`
            }
          ]
        }
      }
    )
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds valuable context: it mentions updating only the portion specified by the user (partial updates), confirming with the user before proceeding, and handling inexact name matching. However, it doesn't cover critical aspects like whether this is a destructive operation, what permissions are required, error handling, or what happens to unspecified fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with four sentences, each adding value: the core purpose, partial update behavior, user confirmation requirement, and prerequisite tool usage. It's front-loaded with the main action. However, the last sentence about name matching could be integrated more smoothly, and some redundancy exists (e.g., 'by name' is implied in the schema).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides moderate context: it covers the update operation, partial updates, user confirmation, and prerequisite steps. However, for a mutation tool with three required parameters, it lacks details on error conditions, side effects, return values, and security implications. The schema handles parameter documentation well, but behavioral aspects are incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema—it mentions 'name' and 'portion specified by the user' but doesn't clarify parameter interactions or usage nuances. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('update') and resource ('routine by name'), making the purpose immediately understandable. It distinguishes from siblings by focusing on updating rather than creating, deleting, or loading routines. However, it doesn't explicitly contrast with 'create-routine' beyond the verb difference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool vs alternatives: it mentions using 'load-routines' to get the list of all routines first, which implies this tool should be used after identifying the routine to update. It also specifies that the user may supply a name that's not exactly as stored, indicating a prerequisite step of name matching.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mquan/routine'

If you have feedback or need assistance with the MCP directory API, please join our Discord server