Skip to main content
Glama

change_signature

Destructive

Add, remove, or reorder a Python function’s parameters and update every call site using type-resolved references, with previews for unsafe or ambiguous edits.

Instructions

Add, remove or reorder a function's parameters and update every call site. Example: change_signature(name="send_mail", add=[{"name": "retries", "annotation": "int", "default": "3"}]).

name is a function, a method (Class.method) or a class (its __init__).

  • add: list of {"name", "annotation"?, "default"?, "value"?, "position"?, "keyword_only"?}. default is written in the definition and callers need not change; value is inserted at every call site as name=value (give both for a required-at-call parameter with a default). position is a 0-based index among the parameters (self/cls not counted); the default is the end. One of default/value is required.

  • remove: parameter names; the matching argument is dropped at each call.

  • reorder: the complete new order of the named parameters. Positional arguments are rearranged, and turned into keywords where a position would no longer line up.

Call sites come from the type checker's references, so calls through injected dependencies and typed attributes are found, not just textual matches. Overriding methods get the same change (include_overrides). Calls using *args/**kwargs and places where the function is passed around as a value are listed as manual work rather than guessed at. Unresolved alias calls, calls with comments, and effectful argument reorderings are also listed for manual review. Decorators and docstrings mentioning removed parameters produce notes. Writes when new errors stay within max_new_errors (default 0), else previews with an id for apply_edit; apply=false always previews.

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>"
    },
    "name": "change_signature"
  }
}

Input Schema

NameRequiredDescriptionDefault
addNo
nameYes
applyNo
removeNo
reorderNo
file_pathNo
allow_largeNo
max_new_errorsNo
include_overridesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.4

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare destructive/not-idempotent/write; the description goes far beyond by disclosing the type-checker-based reference resolution, the max_new_errors gate (default 0) that blocks writes, what gets listed as manual work (*args/**kwargs, pass-as-value, unresolved aliases, comments, effectful reorders), and side notes for decorators/docstrings. That is exactly the behavioral context a destructive refactor tool needs.

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?

Long but front-loaded with the core action and an example, then organized into parameter bullets and a behavior paragraph. A few trailing sentences pack multiple distinct behaviors (aliases, comments, reorders, decorators) together, costing some scanability, but there is little outright waste.

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, multi-mode refactoring tool with no output schema and zero schema coverage, the description supplies nearly everything needed to call it safely: mode semantics, the error-budget gate, and preview mechanics. Missing pieces are the meaning of file_path/allow_large and what a preview response actually contains beyond an id.

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 description coverage is 0% across 9 parameters, so the description carries the burden and does so for most of them: name forms (function/method/Class.__init__), the add sub-object fields and semantics of default vs value vs position vs keyword_only, remove/reorder meaning, include_overrides, max_new_errors, and apply. file_path and allow_large are never explained, leaving a gap.

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

Purpose5/5

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

Opens with a specific verb triple and resource: 'Add, remove or reorder a function's parameters and update every call site.' The scope (call-site rewriting) distinguishes it clearly from siblings like rename_symbol, move, or edit_symbol, and the example makes the operation concrete.

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?

Explains the apply-vs-preview flow ('apply=false always previews', 'previews with an id for apply_edit'), which routes the agent to the correct follow-up tool. It does not explicitly contrast with rename_symbol or edit for the cases where signature change is the wrong choice, so it stops short of full alternative guidance.

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