Skip to main content
Glama

Update Python tool

update_python_tool
Destructive

Change a Python tool's code, or what it does, in place: the variables a person gave it to read, its inputs and its group stay. Held to create_python_tool's own checks; its code holds no key.

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": {
      "name": "<name>",
      "code": "<code>"
    },
    "name": "update_python_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesIts whole new code. Reads `_args`, prints its result.
nameYesThe Python tool's name
was_sha256NoThe sha256 of the code this change was read from: a tool changed since is refused
descriptionNoWhat it does, in new words
confirm_tokenNoLeave out at first: the answer previews what this would do and gives a token. Call again with the same arguments and that token to do it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and non-idempotent, and the description adds genuinely new context: what is preserved (variables, inputs, group), that the change is validated against create_python_tool's checks, and that the code must not contain a key/secret. It does not explain the preview-then-confirm two-phase behavior, but the confirm_token parameter documents that.

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?

Two dense sentences with the mutation scope and preservation guarantee front-loaded; nothing is wasted. The telegraphic phrasing ('its code holds no key') is slightly opaque but short and readable.

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 destructive in-place mutation with no output schema, the description covers preservation semantics, validation, and a secret-handling constraint. The confirm-token preview flow and failure modes are left to the schema, which is acceptable given full parameter coverage.

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 all five parameters are already documented, including was_sha256 concurrency protection and confirm_token's two-step flow. The description adds only a light constraint ('its code holds no key') and the note about preserved inputs; baseline 3 is appropriate.

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 gives a specific verb and resource ('Change a Python tool's code ... in place') and immediately scopes it by stating that variables, inputs, and group are preserved. It references create_python_tool as the related creation path, so the agent can distinguish editing from creating, though the boundary is implied rather than spelled out.

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

Usage Guidelines3/5

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

Usage is implied: use this to modify an existing tool's code while keeping its inputs and group, rather than creating a new one. There is no explicit 'when not to use' or routing to alternatives such as test_python_tool for verification, leaving the agent to infer the workflow.

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.