Skip to main content
Glama

get_symbol

Fetch code definitions by name, key path, or heading slug from parsed source, with modes for source, signature, or doc, and return all candidates for ambiguous matches.

Instructions

Fetch definitions by name, key path, or heading slug.

mode: "source" (default) returns the body, "signature" and "doc" omit it. A name matching several different symbols returns candidates rather than guessing. A name matching several definitions of the same thing — many Lua listeners on one event — returns all of them in "symbols". line: pick one definition by the start_line a candidate reported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineNo
modeNosource
nameYes
pathNo
max_tokensNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden and does substantial work: it explains mode behavior ('source' returns the body, 'signature' and 'doc' omit it), ambiguity resolution (returns candidates rather than guessing), and line-based disambiguation by start_line. It does not cover errors, permissions, or max_tokens effects, but the core selection behavior is transparent.

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?

The description is compact and front-loaded with the main purpose. The mode and line notes are dense but scannable. It avoids filler, though the ambiguity discussion could be tightened slightly without losing value.

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

Completeness3/5

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

For a moderate-complexity tool with five parameters and no output schema, the description covers the primary ambiguity-handling behavior and mode semantics. It does not explain max_tokens, the exact meaning of path, or how the returned candidates/symbols are structured. It is adequate for basic use but incomplete for full confident invocation.

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 coverage is 0%, so the description must add parameter meaning. It explains mode values and the line parameter, and mentions lookup by name, key path, or heading slug. However, it does not map 'key path' and 'heading slug' to specific parameters, and it leaves max_tokens entirely undocumented. Partial compensation, but with real gaps.

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 first sentence states a clear action and resource: 'Fetch definitions by name, key path, or heading slug.' It conveys the tool's core function and gives some sense of the lookup keys. It does not explicitly contrast with sibling tools like search_symbols, but the specificity of fetching definitions rather than searching or outlining is enough to distinguish it.

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

Usage Guidelines2/5

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

No explicit guidance is given about when to prefer get_symbol over siblings such as search_symbols, get_docstrings, or ast_query. The mode and line details are usage-related, but they explain how to call the tool, not when it should be selected. The description leaves alternatives and exclusions to inference.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/matthew-brough/AST_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server