Skip to main content
Glama
DarkEden-coding

TreeSitter Code Structure MCP Server

analyze_code_structure

Extract structural elements like classes, functions, parameters, and return types from source code files to facilitate codebase navigation and analysis across multiple programming languages.

Instructions

Analyze the structure of one or more source code files and return classes, functions, their line numbers, nesting levels, parameters, and return types. Supports Python, JavaScript, TypeScript, Java, C#, and Go. Accepts either a single file path (string) or an array of file paths.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath(s) to the source code file(s) to analyze
include_docstringsNoWhether to include docstrings in the output (default: false)
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses behavioral traits such as the types of analysis performed and supported languages, but it does not cover aspects like error handling, performance characteristics, or authentication needs. The description adds useful context but leaves gaps in behavioral disclosure.

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 the core purpose, followed by supporting details in two efficient sentences. Every sentence adds value: the first defines the analysis scope and output, the second specifies languages and input formats. There is no wasted text.

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?

Given the complexity of code analysis, no annotations, and no output schema, the description is moderately complete. It covers the purpose, input formats, and languages, but lacks details on output structure, error cases, or limitations. This is adequate for basic understanding but could be more comprehensive for a tool of this nature.

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 schema fully documents the parameters. The description adds marginal value by mentioning the input format options (single file path or array) and supported languages, but it does not provide additional semantic details beyond what the schema already specifies. Baseline 3 is appropriate here.

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 specific action ('analyze the structure'), the target resource ('source code files'), and the detailed output ('classes, functions, their line numbers, nesting levels, parameters, and return types'). It also specifies supported programming languages, making the purpose highly specific and comprehensive.

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 by specifying supported languages and input formats (single file path or array), but it does not provide explicit guidance on when to use this tool versus alternatives, prerequisites, or exclusions. With no sibling tools, this is adequate but lacks explicit contextual framing.

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/DarkEden-coding/CodeStructureMCP'

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