Skip to main content
Glama
pwno-io

treesitter-mcp

by pwno-io

treesitter_get_call_graph

Generate a call graph for a source file, mapping function calls and their relationships to reveal code structure and dependencies.

Instructions

Generate a call graph showing function calls and their relationships.

Args: file_path: Path to the source code file output_file: If provided, writes result to this file instead of returning. Useful for large outputs to prevent context overload.

Returns: Dictionary containing: - nodes: List of CallGraphNode objects, each with: - name: Function name - location: Source location (start/end points) - calls: List of function names called by this function OR if output_file is set: {"status": "written", "output_file": "...", "bytes_written": N}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
output_fileNo
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly details the return structure and the alternate file-writing behavior, including the status dict. This is strong transparency for a read-only analysis tool, though it does not cover potential errors or edge cases.

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 front-loaded with a clear one-sentence summary, followed by compact Args and Returns sections. It is concise, well-structured, and every sentence provides value without redundancy.

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?

The description covers the core functionality, parameter effects, return format, and the alternative output mode, which is sufficient given the tool's simplicity and lack of an output schema. Minor gaps like error handling or language support are not critical for basic usage.

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

Parameters5/5

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

The schema has no parameter descriptions (0% coverage), so the description's explanations of file_path and output_file add essential meaning. It goes beyond the schema by explaining the default behavior (returns graph) and the conditional behavior (writes to file and returns status).

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 generates a call graph showing function calls and their relationships, using a specific verb and resource. This distinguishes it from sibling tools like treesitter_get_dependencies or treesitter_get_ast.

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

Usage Guidelines4/5

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

The description provides clear context on when to use the tool (to obtain a call graph) and gives a practical tip about using output_file for large outputs to prevent context overload. However, it does not explicitly mention alternative tools or when not to use it.

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/pwno-io/treesitter-mcp'

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