Skip to main content
Glama
python-docs-mcp-server

python-docs-mcp-server

compare_versions

Read-onlyIdempotent

Diff a Python standard library symbol between two indexed versions to see whether it was added, removed, changed, or unchanged, with version and signature details.

Instructions

Diff a Python stdlib symbol between two indexed versions. Returns change=added|removed|changed|unchanged with optional new_in, changed_in, deprecated_in, signature_delta (advisory), see_also_added/removed, section_diff, and note fields. Both versions must be indexed; otherwise an actionable error names the available versions.

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": {
      "symbol": "<symbol>",
      "v1": "<v1>",
      "v2": "<v2>"
    },
    "name": "compare_versions"
  }
}

Input Schema

NameRequiredDescriptionDefault
v1YesPython version string, e.g. '3.11'
v2YesPython version string, e.g. '3.11'
symbolYesQualified Python symbol name, e.g. 'asyncio.TaskGroup'

Output Schema

NameRequiredDescriptionDefault
v1YesSource Python version
v2YesTarget Python version
noteNoOptional advisory note about result completeness, e.g. when docs pages could not be fetched for one or both versions and the diff is therefore based on symbol presence alone.
changeYesDiff discriminator: 'added' (symbol new in v2), 'removed' (symbol absent in v2), 'changed' (symbol present in both with a detected delta), or 'unchanged' (symbol present in both, no delta)
new_inNoVersion string extracted from the v2 section text; populated when change == 'added', and may also be set when change == 'changed' if the v2 section carries a versionadded marker for a sub-feature
symbolYesQualified symbol name being compared
changed_inNoVersion extracted from the v2 section; populated when change == 'changed'
removed_inNoVersion where the symbol is first absent; populated when change == 'removed' (equals v2)
section_diffNoShort unified-diff snippet (difflib.unified_diff), truncated to honor the token budget; populated only when change == 'changed' and the diff is non-trivially short
deprecated_inNoVersion extracted from a deprecation marker in the v2 section
see_also_addedNoSee-also link labels present in v2 but not v1
signature_deltaNoBest-effort heuristic: first non-empty diff line between v1 and v2 section text. MAY be a docstring change or prose change rather than a true signature change — treat as advisory, not authoritative.
see_also_removedNoSee-also link labels present in v1 but not v2

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.1
    • changedOutput schema / description
      Previous value: -"Output from compare_versions tool (CMPR-01, CMPR-03).\n\nTyped contract returned by CompareService.compare and the source FastMCP\nauto-derives the compare_versions outputSchema from. The four ``change``\ncases (added / removed / changed / unchanged) all share this shape;\noptional delta fields are ``None`` when they do not apply to the case,\nkeeping the JSON shape predictable and token-frugal (no full re-printing\nof unchanged content, per CMPR-03)."New value: +"Output from compare_versions tool (CMPR-01, CMPR-03).\n\nTyped contract returned by CompareService.compare and the source MCPServer\nauto-derives the compare_versions outputSchema from. The four ``change``\ncases (added / removed / changed / unchanged) all share this shape;\noptional delta fields are ``None`` when they do not apply to the case,\nkeeping the JSON shape predictable and token-frugal (no full re-printing\nof unchanged content, per CMPR-03)."
  2. Addedv0.3.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare the safe read-only, idempotent, non-destructive profile. The description adds meaningful behavior beyond that: the possible change values, optional advisory fields, and the error behavior when a version is not indexed.

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?

The purpose is front-loaded in the first sentence, followed by return shape and prerequisite/error behavior. Every sentence carries useful information with no filler.

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?

Given the output schema and annotations, the definition is largely complete: it states what is compared, what change values may return, and the indexed-version prerequisite. The main missing piece is explicit guidance on choosing this tool over sibling alternatives.

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 the parameter meanings are already well documented. The description adds the constraint that both v1 and v2 must be indexed, which is useful, but it does not add further syntax or format semantics for symbol or version strings.

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?

States a specific verb and resource: diff a Python stdlib symbol between two indexed versions. It is clearly distinct from lookup/search/get docs tools, but it does not explicitly name or contrast with close siblings like whatsnew_for_version.

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?

The description gives an important precondition (both versions must be indexed) and says an actionable error names available versions. However, it does not say when to choose this over whatsnew_for_version or lookup_package_docs, so usage guidance is implied rather than explicit.

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