Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

MCP Tools Reference

Lexa's MCP server exposes 22 tools. The table below summarizes every one. Use the per-tool headings below for input schemas and notes.

At a glance

ToolCLI equivalentRequired inputNotes
fileslexa filesoptional filtersFilters by path / glob / language / line count.
listlexa listoptional pathImmediate children of a directory.
globlexa globpatternGlob match against indexed paths.
path_searchlexa path-searchqueryFuzzy path search.
outlinelexa outlinepathSymbols and imports for one file.
symbol_defslexa symbol-defsnameExact symbol definitions.
symbol_searchlexa symbol-searchqueryFuzzy symbol search.
word_refslexa word-refswordExact identifier occurrences (incl. declarations).
text_searchlexa text-searchquerySubstring or regex text search.
callerslexa callersnameNon-definition call sites / usages.
brieflexa brieftaskCompact context bundle for a code task.
trace_depslexa trace-depspathResolved imported_by / depends_on edges.
readlexa readpathRead with optional line range, compact, if_hash.
patchlexa patchpath, opLine-based edit with if_hash and dry_run.
createlexa createpathCreate a file; refuses overwrites unless asked.
changeslexa changesoptional sinceSession-local change history.
recentlexa recentoptional limitRecently modified files.
statuslexa statusIndex status.
reindexRebuild the in-memory index; persist when persistence is enabled.
clear_indexlexa clear-indexClear in-memory index and remove the graph file.
auditlexa auditoptional includeSee Audit CLI page for the full schema.
pipelinelexa pipelinesteps or pipelineComposable query chain.

tool-files

{
  "name": "files",
  "arguments": {
    "path": "apps/desktop",
    "path_glob": "**/*.{ts,tsx}",
    "language": "typescript",
    "min_lines": 50,
    "max_lines": 500,
    "max_results": 20
  }
}

max_results is canonical; max is accepted as a compatibility alias. The response includes count, total, limit, truncated, filters, and a files array.

tool-list

{ "name": "list", "arguments": { "path": "apps/desktop" } }

Returns { path, count, entries[] } — only the immediate children.

tool-glob

{ "name": "glob", "arguments": { "pattern": "**/*.rs" } }

Returns { pattern, count, total, limit, truncated, paths[] }.

tool-path_search

{ "name": "path_search", "arguments": { "query": "termnl-sess", "max_results": 5 } }

Returns { query, count, limit, results: [{ path, score }] }.

tool-outline

{ "name": "outline", "arguments": { "path": "src/main.rs" } }

Returns { path, language, line_count, byte_size, symbol_count, imports, unresolved_imports, symbols[] }. Since v0.6.0 imports are kept out of the symbol list.

tool-symbol_defs

{ "name": "symbol_defs", "arguments": { "name": "Engine" } }

tool-symbol_search

{ "name": "symbol_search", "arguments": { "query": "createAgent", "max_results": 10 } }

Fuzzy — createAgent will also match createProjectAgent and friends.

tool-word_refs

{ "name": "word_refs", "arguments": { "word": "Engine" } }

Includes declarations and definitions. For non-definition call sites only, use callers.

tool-text_search

{
  "name": "text_search",
  "arguments": {
    "query": "useEffect",
    "max_results": 20,
    "regex": false,
    "scope": true,
    "compact": false,
    "paths_only": false,
    "path_glob": "**/*.{ts,tsx}"
  }
}

tool-callers

{ "name": "callers", "arguments": { "name": "createProjectAgent", "max_results": 20 } }

Narrower than word_refs — skips declaration-like occurrences such as type aliases.

tool-brief

{
  "name": "brief",
  "arguments": {
    "task": "createProjectAgent",
    "max_results": 10,
    "path_prefix": "packages/agents",
    "path_glob": null,
    "language": "typescript"
  }
}

Returns a ContextDetails object with suggested next steps, relevant symbols, and relevant snippets. path is accepted as a path_prefix alias. Brief is a context bundler, not natural-language QA — vague queries return low-confidence results with suggested next steps.

tool-trace_deps

{
  "name": "trace_deps",
  "arguments": {
    "path": "src/main.rs",
    "direction": "imported_by",
    "transitive": true
  }
}

direction is one of imported_by (default) or depends_on. External packages are not returned as dependency nodes; unresolved local imports are reported separately in the depends_on direction.

tool-read

{
  "name": "read",
  "arguments": {
    "path": "src/main.rs",
    "line_start": 1,
    "line_end": 80,
    "compact": false,
    "if_hash": "4f8a3c1e..."
  }
}

Text content is prefixed with hash: when not in if_hash short-circuit mode. if_hash short-circuits when the on-disk hash matches.

tool-patch

{
  "name": "patch",
  "arguments": {
    "path": "src/main.rs",
    "op": "replace",
    "content": "    println!(\"updated\");",
    "range_start": 12,
    "range_end": 12,
    "if_hash": "4f8a3c1e...",
    "dry_run": false
  }
}

op is one of replace, insert, delete. For insert, pass after instead of a range. Always read with read first and pass the resulting hash to if_hash to detect concurrent changes.

tool-create

{
  "name": "create",
  "arguments": {
    "path": "src/new_file.rs",
    "content": "pub fn new_file() {}",
    "overwrite": false,
    "dry_run": false
  }
}

Refuses to overwrite an existing file unless overwrite: true.

tool-changes

{ "name": "changes", "arguments": { "since": 0 } }

since is a session-local sequence number, not a git ref. The change log is not persisted to the graph snapshot.

tool-recent

{ "name": "recent", "arguments": { "limit": 10 } }

tool-status

{ "name": "status" }

Returns { files_indexed, symbols_indexed, unique_words_indexed, word_indexed_files, seq, change_history_persisted, graph }.

tool-reindex

{ "name": "reindex" }

Rebuilds the in-memory index from the MCP project root and persists when persistence is enabled.

tool-clear_index

{ "name": "clear_index" }

Clears the in-memory index and removes the graph file. Returns { cleared, graph_removed, graph }.

tool-audit

{
  "name": "audit",
  "arguments": {
    "max_results": 20,
    "since": "main",
    "config": "lexa.toml",
    "no_config": false,
    "include": ["dead-code"]
  }
}

max_results is canonical; max is a compatibility alias. config is a TOML file path, not a named preset. Strict mode is a CLI-only flag. See the Audit CLI page for the full output shape and the groups vs findings rule.

tool-pipeline

{
  "name": "pipeline",
  "arguments": {
    "steps": ["search AgentRunRequest", "limit 3"]
  }
}

Or, if you prefer a single string:

{
  "name": "pipeline",
  "arguments": {
    "pipeline": "search AgentRunRequest | limit 3"
  }
}

See the Pipeline CLI page for the full list of operations.