Tree-Sitter Language Pack

v1.28.0
io.github.xberg-io/tree-sitter-language-pack Checked 1 hour ago Published 4 days ago

Parse source code, extract structure and symbols, and chunk files for LLMs across 300+ languages.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

cache_dir

Return the effective parser cache directory path.

clean_cache

Delete all cached parser libraries from the cache directory.

detect_language

Detect the language for a file path or source content. Returns the detected language name.

ParameterTypeDescription
contentstring | nullSource content used for content-based detection.
pathstring | nullFile path or name used for extension-based detection.

download

Download parser libraries from the remote registry. Pass languages list, groups, or all=true. Set fresh=true to clean the cache first.

ParameterTypeDescription
allboolean | nullDownload all available languages.
freshboolean | nullClean the cache before downloading for a fresh fetch. Default: false.
groupsarray | nullNamed groups to download. The manifest currently defines exactly one group, `"all"`; call `manifest_groups` to enumerate the names that actually exist.
languagesarray | nullSpecific language names to download.

info

Show whether a language is known, downloaded, and its cache path.

ParameterTypeDescription
language *stringLanguage name to inspect.

list_languages

List languages. source: 'available' (default), 'downloaded', or 'manifest'. Optional substring filter.

ParameterTypeDescription
filterstring | nullOptional substring filter applied to the result.
sourcestring | nullWhich set to query: `"available"` (default), `"downloaded"`, or `"manifest"`.

parse

Parse source code with a tree-sitter grammar. Returns the syntax tree as sexp or JSON.

ParameterTypeDescription
language *stringLanguage name (e.g. `"python"`). Required.
source *stringSource code to parse.
formatstring | nullOutput format: `"sexp"` (default) or `"json"`.

process

Run the code-intelligence pipeline on source code. Extracts structure, imports, exports, symbols, and more.

ParameterTypeDescription
language *stringLanguage name (e.g. `"rust"`). Required.
source *stringSource code to analyse.
allboolean | nullEnable every analysis feature. Overrides the individual flags below when true.
chunk_max_sizeinteger | nullMaximum chunk size in bytes (`None` disables chunking).
commentsboolean | nullExtract comments. Default: false.
data_extractionboolean | nullEnable hierarchical data extraction for data-format files. Default: false.
diagnosticsboolean | nullInclude parse diagnostics. Default: false.
docstringsboolean | nullExtract docstrings. Default: false.
exportsboolean | nullExtract export statements. Default: true.
importsboolean | nullExtract import statements. Default: true.
structureboolean | nullExtract structural items (functions, classes). Default: true.
symbolsboolean | nullExtract symbol definitions. Default: false.