Skip to main content
Glama

get_code_snippet

Read-onlyIdempotent

Fetch source code or outlines for any symbol, auto-bounding large containers and applying line limits for full restores.

Instructions

Read a search_graph symbol. auto bounds source and outlines large containers; full restores up to 500 lines. Source/outline pages continue; coverage_note marks gaps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNotree
projectYes
max_linesNo
start_lineNo
source_modeNoauto outlines 200+ line containers; full returns source; outline lists members.auto
member_limitNo
member_offsetNo
qualified_nameYessearch_graph qn, or short name.
include_neighborsNo
max_output_tokensNoauto/outline sizing hint (default 2500), hard ceiling 4 UTF-8 bytes/token. Lines stay whole; explicit full is uncapped unless set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.11.0
    • addedInput schema / properties / format
      Added value: +{
      +  "default": "tree",
      +  "enum": [
      +    "tree",
      +    "json"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / max_lines
      Added value: +{
      +  "maximum": 500,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_output_tokens
      Added value: +{
      +  "description": "auto/outline sizing hint (default 2500), hard ceiling 4 UTF-8 bytes/token. Lines stay whole; explicit full is uncapped unless set.",
      +  "maximum": 1000000,
      +  "minimum": 128,
      +  "type": "integer"
      +}
    • addedInput schema / properties / member_limit
      Added value: +{
      +  "default": 50,
      +  "maximum": 500,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / member_offset
      Added value: +{
      +  "default": 0,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • changedInput schema / properties / qualified_name / description
      Previous value: -"Full qualified_name from search_graph, or short function name"New value: +"search_graph qn, or short name."
    • addedInput schema / properties / source_mode
      Added value: +{
      +  "default": "auto",
      +  "description": "auto outlines 200+ line containers; full returns source; outline lists members.",
      +  "enum": [
      +    "auto",
      +    "full",
      +    "outline"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / start_line
      Added value: +{
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. Changed1 schema field changedv0.10.4
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  3. Changed1 schema field changedv0.9.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observedv1.0.0

TDQS

B3.3/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior. The description adds useful behavioral detail: auto mode bounds source, full mode restores up to 500 lines, pagination continues across pages, and coverage_note marks gaps. This goes beyond the annotations, though 'full restores up to 500 lines' is slightly ambiguous given the uncapped note on max_output_tokens.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences with the core purpose front-loaded. The phrasing is terse, bordering on cryptic, but every clause carries relevant information and there is no filler.

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

Completeness2/5

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

Given 10 parameters, only 30% schema coverage, and no output schema, the description is not complete enough for reliable tool invocation. It hints at paging and coverage notes but omits how to configure pagination, what output formats look like, and how optional features such as include_neighbors behave.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 30% across 10 parameters, so the description carries a heavy burden. It adds some meaning for source_mode and line limits, but it does not clarify qualified_name, project, format, start_line, member_offset, member_limit, include_neighbors, or max_output_tokens. This is not enough compensation for the large undocumented parameter set.

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 uses a specific verb ('Read') and resource ('a search_graph symbol'), making the core purpose clear. It does not explicitly distinguish from siblings like get_file_outline or search_graph, so it falls just short of a 5.

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 some usage context around source modes and pagination ('auto bounds source and outlines large containers; full restores up to 500 lines; Source/outline pages continue'). However, it never tells an agent when to prefer this tool over alternatives such as get_file_outline or search_code, nor states exclusions.

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