Skip to main content
Glama

Explain a Python import/attribute/signature error

explain_error
Read-onlyIdempotent

Diagnose Python ImportError, ModuleNotFoundError, AttributeError, and TypeError failures caused by library API changes. Returns what changed, in which release, replacements, and the version pin that restores the old API.

Instructions

Call this when a third-party Python library raises ImportError ('cannot import name'), ModuleNotFoundError, AttributeError ('has no attribute'), or TypeError ('unexpected keyword argument' / 'missing required argument'). Returns what changed, in which release, the deprecation message, replacement candidates with evidence, and the version pin that restores the old API. Pass installed versions for an exact answer.

Input Schema

NameRequiredDescriptionDefault
tracebackYesTraceback text, or at least the final 'SomeError: message' line. Long logs are fine: only the last 20,000 characters are analysed.
pip_freezeNoOutput of `pip freeze` / `uv pip freeze` / `pip list`.
installed_versionsNoInstalled versions, e.g. {"httpx": "0.28.1"}.

Output Schema

NameRequiredDescriptionDefault
noteNo
signalYes
findingsYes
not_coveredNoPackages involved in the error that DepTime does not index.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, closed-world), so the bar is lower; the description nonetheless adds real behavioral context: it produces change history, release, deprecation text, replacement candidates with evidence, and a restorative version pin. 'Pass installed versions for an exact answer' discloses an important accuracy tradeoff not encoded anywhere in the schema, and 'third-party Python library' implicitly bounds scope.

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

Conciseness5/5

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

Three sentences, zero waste: trigger conditions first, then the returned diagnostic payload, then the accuracy hint. Every sentence carries distinct information and nothing is repeated from structured fields.

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?

With 3 params at full schema coverage and an output schema present, the description is nearly complete: call conditions, output contents and optional-input payoff are all covered. What is absent is fallback behavior when no matching release change is found, and explicit confirmation that non-version-related errors are out of scope.

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 100%, so the baseline is 3; the description earns an extra point by explaining why the optional inputs matter ('Pass installed versions for an exact answer'), which the schema only describes as 'Installed versions'. It does not otherwise add syntax guidance beyond the schema, so it stays below 5.

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?

States a specific verb (explain/diagnose) tied to a precise resource: third-party Python import/attribute/signature errors, enumerated by exception class and quoted message fragments. An agent can immediately distinguish this from siblings like symbol_history, check_symbols, diff_versions and coverage, which address symbols, checks and coverage rather than runtime error diagnosis.

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?

The opening sentence is an explicit trigger: 'Call this when a third-party Python library raises ImportError ... ModuleNotFoundError ... AttributeError ... TypeError', which is unusually actionable routing guidance. It does not name sibling tools or state when-not to use it (e.g. stdlib errors or non-version-related failures), which keeps it out of the top band.

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