Skip to main content
Glama
thousandmiles

Semantic Code MCP Server

get_definition

Find where a symbol is defined by passing its usage location. Returns the file path, line, and character of the definition.

Instructions

Get the definition location of a symbol. Returns the file path, line, and character where the symbol is defined. Tip: Use 'search_in_file' to find the exact line and character of the symbol you are interested in.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineYesThe 0-based line number where the symbol is located
filePathYesThe absolute path to the file containing the symbol usage (e.g. /path/to/project/src/index.ts)
characterYesThe 0-based character offset on the line where the symbol is located

Schema Changelog

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

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses that the tool returns a definition location and implies a read-only operation, but it does not mention behavior when a definition is not found or when multiple definitions exist.

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?

The description is compact and front-loaded: it states the core purpose first, then the return value, then a practical tip. Every sentence earns its place without unnecessary detail.

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 symbol lookup tool, the description covers the main action, inputs (via schema), and return information adequately. It would be more complete with explicit notes on error behavior or handling of ambiguous definitions, but as-is an agent has enough to invoke it correctly.

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 the parameters are already well documented. The description's tip adds workflow context for obtaining line and character values but does not substantially extend the semantic meaning of the parameters beyond the schema.

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 clearly states the verb ('Get'), the resource ('definition location of a symbol'), and the return payload (file path, line, character). It is distinguishable from sibling tools like get_references by the focus on 'definition,' though it doesn't explicitly contrast with them.

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 tip to use search_in_file to find the exact line and character provides useful preparatory guidance, implying when an agent should first gather the input location. However, it does not explicitly explain when to choose get_definition over alternatives such as get_references or check_function_call.

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/thousandmiles/lsp-mcp-server'

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