Skip to main content
Glama
AST-Navigator-MCP

AST-Navigator-MCP

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
AST_NAVIGATOR_LOG_LEVELNoLog level for the server. One of: debug, info (default), warn, error. Logs go to stderr.info

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_file_structureA

Outline one JavaScript/TypeScript source file from its Tree-sitter syntax tree: imports (ESM, CommonJS require, re-exports), classes with their properties and methods, top-level functions (declarations, arrow functions, function expressions, CommonJS exports) and TypeScript interfaces / type aliases / enums, each with 1-based line ranges and signatures exactly as written.

Use it to learn a file's API and dependencies without reading the whole file, and to find which lines to read next. It does not return function bodies or nested local helpers.

Args:

  • filePath (string): file to analyse (.js .mjs .cjs .jsx .ts .mts .cts .tsx). Absolute path recommended.

  • responseFormat ('markdown' | 'json'): 'markdown' (default) is a compact outline; 'json' returns the full object.

Returns (structuredContent, identical to the 'json' text): { filePath, language, lineCount, hasSyntaxErrors, syntaxErrorLines[], imports[{ source, kind: esm|commonjs|re-export, typeOnly, specifiers[{ kind, name, importedName? }], line }], classes[{ name, exported, defaultExport, abstract, extends?, implements[], properties[{ name, static, readonly, visibility?, type?, line }], methods[{ name, kind: constructor|method|getter|setter, static, async, abstract, visibility?, signature, startLine, endLine }], startLine, endLine }], functions[{ name, kind: function|generator|arrow|function_expression|signature, async, exported, defaultExport, signature, startLine, endLine }], types[{ name, kind: interface|type_alias|enum, exported, startLine, endLine }] }

Examples:

  • "What does src/server.ts export?" -> { filePath: "/repo/src/server.ts" }

  • Need exact field values for code generation -> add responseFormat: "json"

Errors (isError=true, text starts with 'Error [CODE]'): FILE_NOT_FOUND, PERMISSION_DENIED, NOT_A_FILE, FILE_TOO_LARGE (> 2 MiB), PATH_OUTSIDE_ROOTS, INVALID_PATH. Unsupported extensions are rejected by input validation. If hasSyntaxErrors is true the outline is best-effort.

find_definitionA

Find where classes, functions, methods, interfaces, type aliases and enums are DEFINED, by name, across every JavaScript/TypeScript file under a directory (recursive). Matching runs on parsed declarations, not raw text, so call sites, comments and strings never match.

Use it to jump from a symbol name to its definition(s), then call get_file_structure on a returned filePath for surrounding context. Not for finding usages/references.

Args:

  • name (string): symbol to find, e.g. "UserService", "parseConfig", or a qualified method "UserService.create".

  • directory (string, optional): directory to search; required (no server root configured).

  • matchMode ('exact' | 'prefix' | 'contains'): default 'exact'.

  • caseSensitive (boolean): default true.

  • kinds (array, optional): any of class, function, method, interface, type_alias, enum.

  • limit (1-200, default 50) and offset (default 0): pagination.

  • responseFormat ('markdown' | 'json'): default 'markdown'.

Returns (structuredContent): { query, directory, matchMode, total, count, offset, hasMore, nextOffset?, filesScanned, filesParsed, skippedFiles, scanTruncated, results[{ name, qualifiedName, kind, container?, exported, signature?, filePath, startLine, endLine }] } Results are ordered by relevance (exact match first), then file path and line.

Examples:

  • "Where is UserService defined?" -> { name: "UserService", kinds: ["class"] }

  • "Which functions start with handle?" -> { name: "handle", matchMode: "prefix", kinds: ["function", "method"] }

Skipped while scanning: node_modules, bower_components, jspm_packages, dist, build, out, coverage, vendor, tmp, dot-directories (.git, .next, ...), symbolic links, minified bundles and files over 2 MiB. A scan stops after 20000 files (scanTruncated=true).

Errors (isError=true, text starts with 'Error [CODE]'): FILE_NOT_FOUND, NOT_A_DIRECTORY, MISSING_DIRECTORY, PERMISSION_DENIED, PATH_OUTSIDE_ROOTS, INVALID_PATH.

analyze_dependenciesA

List the local files one JavaScript/TypeScript file depends on, from its Tree-sitter syntax tree: ES imports (including side-effect and import type), re-exports (export ... from), require() (also TypeScript import x = require()) and dynamic import(), anywhere in the file. Packages (node_modules), node: built-ins and path aliases are counted but not listed.

Use it to follow a module's dependency graph one file at a time, or to see what a file pulls in before changing it. It lists what a file imports, not which files import it.

Resolution mirrors TypeScript/Node.js for local specifiers: exact file, the .ts source behind a .js specifier, extension probing (.ts .tsx .d.ts .mts .cts .js .jsx .mjs .cjs .json) and directory index files. tsconfig 'paths' and package.json 'exports' are not read.

Args:

  • filePath (string): file to analyse (.js .mjs .cjs .jsx .ts .mts .cts .tsx). Absolute path recommended.

  • includeTypeOnly (boolean): include type-only references, erased at compile time (default true).

  • responseFormat ('markdown' | 'json'): 'markdown' (default) is a compact list; 'json' returns the full object.

Returns (structuredContent): { filePath, language, hasSyntaxErrors, dependencies[{ path, specifiers[], kinds[import|re-export|require|dynamic-import], typeOnly, lines[] }], unresolved[{ specifier, reason: not_found|outside_roots|invalid, kinds[], lines[] }], externalCount, nonLiteralCount, truncated } Dependencies are listed in order of first reference; several specifiers naming the same file are merged.

Examples:

  • "What does src/server.ts import from this repo?" -> { filePath: "/repo/src/server.ts" }

  • Runtime dependencies only -> add includeTypeOnly: false

Errors (isError=true, text starts with 'Error [CODE]'): FILE_NOT_FOUND, PERMISSION_DENIED, NOT_A_FILE, FILE_TOO_LARGE (> 2 MiB), PATH_OUTSIDE_ROOTS, INVALID_PATH. A dependency pointing outside the allowed roots is reported as unresolved with reason 'outside_roots'; its target is never revealed.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct role: single-file outline (get_file_structure), symbol definition search across a directory (find_definition), and per-file dependency listing (analyze_dependencies). Descriptions explicitly bound each other out (e.g. find_definition 'not for finding usages', analyze_dependencies 'not which files import it'), so an agent cannot easily misselect. Only minor overlap is that both get_file_structure and find_definition surface declarations, but their input shapes (filePath vs. name/directory) keep them separate.

Naming Consistency5/5

All three names follow the same verb_noun snake_case convention (get_file_structure, find_definition, analyze_dependencies). Verb prefixes are meaningful and non-colliding, and no camelCase or V2-style variants appear.

Tool Count4/5

Three tools is lean but appropriate for a narrow AST navigation server, and each earns its place without redundancy. It sits at the low edge of the ideal range, since the surface covers only the read/inspect direction of the domain.

Completeness3/5

Coverage of the stated read-only navigation domain is coherent — outline, definition lookup, and dependency graph — but there is no reference/usage search (explicitly disclaimed) and no reverse-dependency query, both core navigation operations. Agents must chain multiple find_definition calls, or cannot answer 'who uses this' at all.

Maintenance

ActivitySlowing
ResponsivenessNo recent community issues