Skip to main content
Glama

Turn something you just worked out into a reusable tool

procedure_save

Save a verified browser task as a reusable, parameterized callable tool so future agents invoke it instead of redoing the work.

Instructions

Promote a task you have just completed into a callable tool, so the next agent invokes it instead of working it out again. This is the highest-leverage thing you can leave behind: a lesson still has to be read and applied, a procedure is simply called.

Save one only when you have actually run the code and seen it work in this session.

Parameterize it. If you fetched metrics for one VPS over one time window, the procedure takes (vpsId, hours) — hardcoding the values you happened to use is the single most common way this goes wrong and produces a tool nobody can reuse.

The code runs in the page via evaluate, with your parameters available as params. It must return a value. It is checked against origin before running, so it cannot fire on the wrong site. Mark mutating: true for anything that creates, changes or deletes — those refuse to run without explicit confirmation, and should be rare.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>",
      "name": "<name>",
      "description": "<description>",
      "origin": "<origin>",
      "code": "<code>"
    },
    "name": "procedure_save"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe site this belongs to.
codeYesJS body with `params` in scope. Must return a value. No secrets — they are stripped.
nameYesTool name: lowercase with underscores, descriptive, globally unique. e.g. "hostinger_list_vps".
originYesExact origin it must run on, e.g. "https://hpanel.hostinger.com".
paramsNoThe parameters it accepts.
expectsNoShape of a successful result, so a wrong answer is recognizable.
mutatingNoTrue if it changes state on the site. Defaults to false.
descriptionYesWhat it does, for an agent deciding whether to call it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose important behavior: code runs in the page via evaluate, parameters are available as `params`, results must be returned, origin is checked before execution, and mutating procedures require explicit confirmation. It still leaves some edge cases unstated, such as overwrite behavior or failure responses beyond origin mismatch.

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 front-loaded with purpose, then when to use, then parameterization, then execution and safety details. The structure is clear and most sentences earn their place, though some motivational phrasing ("highest-leverage thing", "single most common way this goes wrong") adds mild verbosity.

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 complex tool with no annotations and no output schema, the description covers the key operational details: when to save, how to parameterize, execution environment, origin enforcement, return requirement, and mutating-procedure confirmation. It is largely complete, though it could say more about failure modes or interactions with sibling procedure tools.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline would be 3, but the description adds meaningful guidance about parameterization: procedures should take reusable inputs such as `(vpsId, hours)` rather than hardcoded values. It also explains that parameters are exposed as `params` in the code body and that `origin` constrains execution. This is useful conceptual meaning beyond the schema field descriptions.

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 states a specific verb and resource: promote a completed task into a callable tool/procedure. It also distinguishes the output from a lesson, noting that a lesson must be read and applied while a procedure is simply called. It does not explicitly differentiate from sibling procedure tools such as procedure_draft, so it stops short of a 5.

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 gives a clear condition for use: save only when you have actually run the code and seen it work in this session. It also warns that mutating procedures should be rare. It does not name alternatives or explicitly state when to use procedure_draft/list instead.

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