Skip to main content
Glama

extract_ast_skeleton

Extract Python class and function signatures, line ranges, and docstrings without reading full files, so agents can locate target functions at zero LLM tokens.

Instructions

Extract class and function signatures, line ranges, and docstrings from Python source code at 0 LLM tokens. Allows agents to locate target functions without reading entire files.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "extract_ast_skeleton"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoRaw Python source code string to skeletonize directly if not reading from disk.
file_pathNoPath to Python source file on disk.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses that extraction is deterministic and free of LLM cost, but says nothing about output shape, how the two source inputs interact when both are supplied, neither being required, or error behavior for invalid Python. Those are real gaps for a zero-annotation tool.

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?

Two short sentences with no filler. The capability list is front-loaded and the efficiency rationale follows as supporting context, so every sentence earns its place.

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?

This is a simple read-only extraction tool with fully documented parameters and no output schema to explain. The description covers purpose and value adequately; only the dual-input precedence and result shape are unaddressed, which is a minor gap rather than a blocking one.

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%, and both parameters are documented in the schema itself, including the hint that code is used when not reading from disk. The description adds no parameter-level meaning, so the baseline of 3 applies; it misses the chance to clarify precedence between code and file_path, which is the one genuinely ambiguous point.

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?

The description names a specific verb ("Extract") and precise resource (Python source code), and enumerates exactly what is returned: class and function signatures, line ranges, and docstrings. An agent knows immediately this is a static-analysis extraction tool, not a file reader or general code runner, which is enough to distinguish it from the unrelated siblings.

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 second sentence establishes clear usage context: use it to locate target functions without reading entire files, with the added framing of zero LLM token cost. It does not name a concrete alternative tool or state exclusions (e.g., when full-file reading is still required), so it stops short of the explicit routing a 5 requires.

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