Skip to main content
Reference · Information

senkani_parse

Live

Return the tree-sitter AST for a file or snippet as structured JSON.

Signature

senkani_mcp.call(tool="senkani_parse", args={...})

Behavior

Runs the appropriate tree-sitter parser and returns the node tree. Useful for agent tasks that need to reason about code structure explicitly (rather than by regex or text match).

Inputs

Name
Type
Default
Description
file
string
File to parse. Alternatively pass `source` + `lang`.
source
string
Source text if not reading from file.
lang
string
auto
Language name; required if using `source`.
max_depth
integer
Limit AST depth.

Output

JSON: `{{type, range, children[]}}` recursively.

Example

{"tool":"senkani_parse","args":{"file":"src/api.ts","max_depth":3}}

Details

Output can be large; use `max_depth` aggressively. For symbol-level needs prefer `senkani_outline` or `senkani_fetch`.

See also

Source: Sources/MCPServer/Tools/ParseTool.swift