Skip to main content
Glama

whats_in_file

Get a hierarchical outline of all symbols in a file—functions, classes, and methods with signatures and line numbers—without loading file content, using roughly 100 tokens instead of 2000.

Instructions

Returns a hierarchical outline of all symbols in a file: functions, classes, methods with signatures and line numbers. No file content loaded. ~100 tokens vs ~2000 for reading the file.

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": {
      "file_path": "<file_path>",
      "repo": "<repo>"
    },
    "name": "whats_in_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name (as shown in list_repos)
file_pathYesRelative file path within the repository (e.g., 'src/main.py')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.10.2

TDQS

A4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and does reasonably well: it states that no file content is loaded, describes the shape of the output (hierarchical outline with signatures and line numbers), and quantifies token cost. It omits any mention of indexing prerequisites or behavior for unindexed/missing files.

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 short sentences, each earning its place: what is returned, what is not loaded, and the cost comparison. The most important information (the return shape) is front-loaded with zero 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?

For a simple two-parameter read tool with no annotations and no output schema, the description covers return structure, cost, and the crucial non-behavior (file content is not loaded). Only the absence of any note on failures or prerequisite indexing keeps it from a 5.

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 both parameters (repo, file_path) are already documented in the schema, including an example path. The description adds no additional parameter semantics, so the baseline of 3 applies.

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?

The description gives a specific verb and resource ('Returns a hierarchical outline of all symbols in a file') and enumerates the contents: functions, classes, methods with signatures and line numbers. It implicitly distinguishes itself from reading file contents, though it does not name a sibling tool by name.

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?

Usage is conveyed through a concrete cost trade-off: '~100 tokens vs ~2000 for reading the file', which tells an agent when this tool is preferable to loading the file. There are no explicit exclusions or named alternatives, which keeps it below a 5.

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