Skip to main content
Glama

Routine Run: write a routine

How to write a routine

how_to_write_a_routine
Read-onlyIdempotent

The JSON form Routine Run reads a routine in: every field, every action a step can take, and what a routine that works in the app has. With part "examples", three routines written in it and the shortcuts the app adds in one tap. Use it when writing a routine for routine_link, start_new_run or propose_new_routine.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "how_to_write_a_routine"
  }
}

Input Schema

NameRequiredDescriptionDefault
partNo"form", the fields and actions, if left out; "examples", three routines in the form and the one-tap shortcuts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / part
      Added value: +{
      +  "description": "\"form\", the fields and actions, if left out; \"examples\", three routines in the form and the one-tap shortcuts.",
      +  "enum": [
      +    "form",
      +    "examples"
      +  ],
      +  "type": "string"
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so safety is covered. The description adds real behavioral content: it discloses what the payload contains (fields, actions, shortcuts) and that the "examples" part yields three concrete routines — telling the agent what it will get back, which annotations cannot. It omits any sense of payload size or verbosity, which is a minor gap for a reference document.

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?

Three sentences, no filler, but the lead sentence is grammatically awkward and buries the purpose behind a convoluted clause, so it is not front-loaded. The usage sentence is well placed at the end, but readability suffers compared to a clean "Returns X" opener.

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

Completeness4/5

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

For a single optional enum parameter, no output schema, and a read-only documentation tool, the description supplies enough: what the content is, what each part yields, and which tools consume it. Nothing an agent needs to call it correctly is missing, though a note on relative payload size between parts would help it choose.

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 coverage is 100% and the enum parameter already documents both values in detail, so the schema carries the burden. The description restates the same split (form = fields and actions; examples = three routines and shortcuts) without adding new semantics such as default behavior when omitted or size trade-offs. Baseline 3 is appropriate here.

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 conveys that this tool returns the JSON form that Routine Run consumes — every field, every step action, and the one-tap shortcuts — which is a specific resource. The phrasing is tangled ("The JSON form Routine Run reads a routine in") rather than a clean verb+resource statement, so the reader must parse intent, but the differentiation from get_routine/propose_new_routine is still evident.

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

Usage Guidelines4/5

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

It names three concrete consumers explicitly: "Use it when writing a routine for routine_link, start_new_run or propose_new_routine." That is clear routing context. It stops short of exclusions (e.g., use get_routine to read an existing routine), so it is not a full when/when-not statement.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.