Skip to main content
Glama

lspGotoDefinition

Read-onlyIdempotent

Jump to the definition of a symbol in your code using LSP. Requires an exact symbol name and line hint from a previous search.

Instructions

Navigate to symbol definition [LOCAL: LSP]

REQUIRES lineHint - call localSearchCode FIRST to get line number

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYesQueries for lspGotoDefinition (1-5 per call). Review schema before use. Batch independent symbol lookups.
responseCharOffsetNoCharacter offset for top-level bulk response pagination across results[]. Use when a multi-query response was auto-paginated.
responseCharLengthNoCharacter budget for top-level bulk response pagination across results[]. Overrides the shared default for this call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultsYesArray of results, one per input query, discriminated by status
responsePaginationNoPagination metadata for top-level bulk response pagination across results[]
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false. The description adds behavioral details: requires lineHint (1-indexed from localSearchCode), symbolName must be exact, tool searches +/-2 lines, batching support (1-5 per call), and pagination parameters. No contradiction with annotations.

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?

Well-structured with markdown sections, front-loaded with purpose. Every section (when, prerequisite, fromTool, toTool, gotchas, examples) provides essential information without redundancy. Concise yet comprehensive.

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?

Given output schema exists, return values need no explanation. The description covers prerequisites, gotchas, relationships with siblings, and examples. For a tool with complex parameter dependencies and batching, this is complete and self-contained.

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

Parameters4/5

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

Input schema has 100% description coverage, so baseline is 3. The description adds value by explaining cross-tool dependencies (lineHint from localSearchCode), exactness of symbolName, and default values for orderHint/contextLines, which helps the agent construct correct parameters beyond schema definitions.

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?

The description clearly states 'Navigate to symbol definition' with specific verb and resource. The <when> section delineates exact use cases (find definition, trace import) and the <fromTool>/<toTool> sections distinguish this from siblings like lspFindReferences and lspCallHierarchy.

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> and <prerequisite> sections state when to use and that lineHint from localSearchCode is required. The <toTool> section lists alternatives (e.g., lspFindReferences for usages) and <gotchas> note when to fall back to external search (packageSearch -> githubGetFileContent).

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

Install Server

Other Tools

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/bgauryy/octocode-mcp'

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