Skip to main content
Glama
pwno-io

treesitter-mcp

by pwno-io

treesitter_get_dependencies

Extract all imports and includes from a source file to list its dependencies. Supports Python and C/C++ files, with optional output to a file.

Instructions

Extract all dependencies (imports/includes) from a source file.

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: List of dependency strings: - For Python: import module names - For C/C++: included file paths (without quotes/brackets) 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 explains the return format for different languages (Python, C/C++) and the behavior of the output_file parameter (writes to file instead of returning). It also notes a key benefit (avoiding context overload). It does not mention error handling or unsupported languages, but the provided details are substantial.

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 well-structured with a clear opening sentence, a brief args section, and a return section. It is concise (about 100 words) and every sentence provides useful information without fluff. The front-loading is effective.

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?

Given the tool's simplicity (2 params, no output schema, no annotations), the description covers the essentials: what it does, how parameters work, and what the return value looks like. It could mention supported languages beyond Python and C/C++, but the core functionality is clearly documented.

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?

Schema description coverage is 0%, so the description must fully compensate. It does: file_path is described as 'Path to the source code file' and output_file is explained as 'If provided, writes result to this file instead of returning. Useful for large outputs to prevent context overload.' This adds clear meaning beyond the bare schema 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 the tool's function with a specific verb+resource: 'Extract all dependencies (imports/includes) from a source file.' This distinctly sets it apart from sibling tools like treesitter_get_ast or treesitter_run_query, which serve different purposes.

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 provides some usage context (e.g., output_file for large outputs to prevent context overload) but does not explicitly mention when to use this tool versus alternatives or when not to use it. The usage is implied by the tool's purpose, but no exclusions or alternative recommendations are provided.

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