Skip to main content
Glama
AbdessamadTzn

FastAPI Architect MCP

go_to_definition

Locate the definition of a symbol by specifying its file, line, and column. Jump directly to the source file and line where a function, class, or variable is defined.

Instructions

Return the file and line where the symbol at the given position is defined.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYes
lineYes
columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main tool handler for 'go_to_definition' – uses Jedi to find the definition location of a symbol at a given position.
    @mcp.tool()
    def go_to_definition(file: str, line: int, column: int) -> dict | None:
        """Return the file and line where the symbol at the given position is defined."""
        script = jedi.Script(path=file, project=_project(file))
        defs = script.goto(line=line, column=column)
        for d in defs:
            if d.module_path:
                return {"file": str(d.module_path), "line": d.line, "column": d.column, "name": d.name}
        return None
  • The tool is registered via the @mcp.tool() decorator on line 70, which registers it with the FastMCP server instance.
    @mcp.tool()
    def go_to_definition(file: str, line: int, column: int) -> dict | None:
  • The helper function _project() is used by go_to_definition to find the Jedi project root for the given file.
    def _project(file: str) -> jedi.Project:
        """Walk up from file to find the project root."""
        path = Path(file).resolve()
        for parent in [path.parent, *path.parents]:
            if any((parent / f).exists() for f in ("pyproject.toml", "requirements.txt", "setup.py")):
                return jedi.Project(path=str(parent))
        return jedi.Project(path=str(path.parent))
Behavior3/5

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

No annotations are provided, but the description is straightforward and does not contradict any. However, it does not disclose any behavioral traits like performance or permissions beyond the basic operation.

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 a single, concise sentence with no unnecessary words, effectively communicating the tool's purpose.

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?

While the description covers the basic purpose, it lacks details about return format, error conditions, or limitations. The presence of an output schema mitigates some gaps, but the description alone is minimal.

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 0%, and the description adds no additional meaning to the parameters (file, line, column) beyond their names. It does not explain indexing conventions or file types.

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 it returns the file and line where a symbol at a given position is defined, using specific verb and resource. It distinguishes from sibling tools like find_references and find_model_usages.

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 implies usage for navigating to a symbol's definition but provides no explicit guidance on when to use versus siblings like find_references or any prerequisites.

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/AbdessamadTzn/fastapi-architect-mcp'

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