Skip to main content
Glama

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
NameRequiredDescriptionDefault
descriptionYesDescription 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
nameYesName of the custom tool to be created
stepsYes

Implementation Reference

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

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

With no annotations provided, the description carries full burden but offers limited behavioral information. It mentions inspecting recently run tools but doesn't disclose what 'create' entails - whether this persists routines, requires permissions, has rate limits, or returns any confirmation. For a creation tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness3/5

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

The description is brief but somewhat vague - 'inspect recently run tools' could be more specific. While concise, it's not optimally front-loaded with the most critical information about what creation entails. The two clauses could be better structured for clarity.

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

Completeness2/5

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

For a creation tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what happens after creation, how routines are stored/accessed, or provide enough context about the 'steps' parameter's relationship to 'recently run actions.' The description should do more to compensate for missing structured information.

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 67%, and the description adds no parameter-specific information beyond what's in the schema. The description doesn't explain what 'recently run actions' means in relation to the steps parameter or provide context about parameter relationships. Baseline 3 is appropriate since the schema does most of the documentation work.

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 tool creates a custom routine from recently run actions, specifying both the verb ('create') and resource ('custom routine'). It distinguishes from siblings by focusing on creation rather than deletion, loading, or updating. However, it doesn't explicitly contrast with siblings in the description text itself.

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

Usage Guidelines2/5

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

The description provides minimal usage guidance - only mentioning 'inspect recently run tools' as a prerequisite. It doesn't specify when to use this versus alternatives like update-routine for modifying existing routines, or provide context about when routine creation is appropriate versus direct tool execution.

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