Skip to main content
Glama

read_file_outline

Extract a file's semantic skeleton—classes, functions, interfaces, docstrings—stripping bodies. Understand API contracts and signatures without implementation details.

Instructions

Extracts the semantic AST skeleton outline of a single source file, preserving all class declarations, function signatures, interfaces, and docstrings while stripping function bodies.

Behavior: Read-only operation. Zero file modifications and zero network calls. Returns syntax-highlighted code block.

When to use: Use this to understand API contracts, public types, and method signatures of an individual file without consuming tokens on implementation details.

When NOT to use: Do NOT use this if you need complete implementation logic (use read_file_content instead), or if you need an overview of multiple repository files (use get_codebase_map instead).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootDirNoBase directory used to resolve relative filePath. Defaults to current working directory (".").
filePathYesRelative or absolute path to the target source file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.2.0
    • changedInput schema / properties / filePath / description
      Previous value: -"Relative or absolute path to the file"New value: +"Relative or absolute path to the target source file."
    • addedInput schema / properties / rootDir
      Added value: +{
      +  "description": "Base directory used to resolve relative filePath. Defaults to current working directory (\".\").",
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral disclosure burden. It explicitly states it is read-only, makes zero file modifications, zero network calls, and returns a syntax-highlighted code block, while also describing the transformation (stripping bodies, preserving signatures). This is comprehensive and unambiguous.

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 description is organized into purpose, behavior, and usage guidance sections, with each sentence contributing value. The core functionality and safety profile are front-loaded, and the alternative tools are mentioned in a dedicated 'when NOT to use' clause. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter, read-only tool with no output schema, the description covers purpose, behavior, return format, and usage boundaries explicitly. An agent has all the information needed to decide when to call it and what to expect in return, making the description complete given the tool's simplicity.

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% for both parameters, with clear meanings for filePath and rootDir. The description does not add parameter-specific details beyond what the schema already provides, so the baseline of 3 applies.

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?

Description states a specific verb ('extracts') and resource ('semantic AST skeleton outline of a single source file'), and details what is preserved (class declarations, function signatures, interfaces, docstrings) and what is stripped (function bodies). It clearly differentiates from siblings by specifying single-file scope and the outline nature.

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

Usage Guidelines5/5

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

Explicit 'When to use' and 'When NOT to use' sections name the exact alternatives (read_file_content for implementation logic, get_codebase_map for multi-file overview) and the conditions that select this tool. Nothing is left to inference.

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