Skip to main content
Glama

Outline symbols

outline_symbol
Read-only

List a source file's top-level functions, classes, types, and interfaces with line numbers so you can understand its structure before reading or refactoring.

Instructions

List a source file's top-level symbols (functions, classes, types, interfaces) with line numbers. Use when: you want a file's structure before reading or refactoring it. Avoid when: you need usages (symbol_references), a text search (search) or the text itself (read_file). Output: total_symbols, symbols[] {name, kind, line, signature}.

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": {
      "relative_path": "<relative_path>"
    },
    "name": "outline_symbol"
  }
}

Input Schema

NameRequiredDescriptionDefault
languageNoOptional language hint (e.g. 'ts', 'py'); the parser auto-detects from the file extension when omitted. The hint is advisory.
max_symbolsNoMax symbols returned (default 200, max 500).
relative_pathYesWorkspace-relative ('.' = root); absolute/.. outside it rejected.
include_classesNotrue includes class/interface symbols (default true).
include_functionsNotrue includes function symbols (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv4.5.0
    • removedInput schema / properties / include_classes / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / include_classes / description
      Previous value: -"1 includes class/interface symbols (default 1)."New value: +"true includes class/interface symbols (default true)."
    • removedInput schema / properties / include_classes / maximum
      Removed value: -1
    • removedInput schema / properties / include_classes / minimum
      Removed value: -0
    • changedInput schema / properties / include_classes / type
      Previous value: -"integer"New value: +"boolean"
    • removedInput schema / properties / include_functions / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / include_functions / description
      Previous value: -"1 includes function symbols (default 1)."New value: +"true includes function symbols (default true)."
    • removedInput schema / properties / include_functions / maximum
      Removed value: -1
    • removedInput schema / properties / include_functions / minimum
      Removed value: -0
    • changedInput schema / properties / include_functions / type
      Previous value: -"integer"New value: +"boolean"
  2. Addedv4.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds a real behavioral trait beyond them – that only top-level symbols are returned, not nested ones – and previews the returned fields ('total_symbols, symbols[] {name, kind, line, signature}'). It doesn't state what happens when max_symbols truncates the result, which keeps it from a 5.

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?

Four short labeled lines – purpose, when, avoid, output – with the verb and scope front-loaded. No redundant restatement of the tool name and 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?

There is no output schema, so the description must describe returns, and it does via the field list. Combined with sibling routing and the top-level scope, an agent has what it needs; only truncation/limit behavior and the meaning of 'signature' are left implicit.

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%, including defaults, ranges and the workspace-relative path constraint, so the schema carries the parameter burden. The description adds only the mention of line numbers and symbol kinds, not guidance on using language hints, max_symbols or the include_* flags. Baseline 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?

States a specific verb and resource ('List a source file's top-level symbols') and narrows scope with the enumerated kinds (functions, classes, types, interfaces) plus line numbers. The 'top-level' qualifier alone lets an agent distinguish it from a deeper symbol lookup without opening any schema.

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 'Use when' clause (structure preview before reading or refactoring) and an 'Avoid when' clause naming three named alternatives (symbol_references, search, read_file) with the condition that selects each. 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.