MCP Tools

Every tool the server exposes over MCP, grouped by what it does.

Search and retrieval

Tools that find things by keyword, pattern, or meaning.

searchAxonExamples

Keyword search across indexed Axon code. Supports category and tag filters. Returns the top matches with a relevance score and a short snippet.

searchAxonOperatorExamples

Search specifically for operator usage — pass >=, ==, +, etc., and the server returns real examples where the operator is used in context.

searchAxonDocs

FlexSearch across the HTML and Markdown documentation tree. ~50 ms query time; results include heading hierarchy and excerpted snippets.

searchAxonRegex

grep-style regex search in code. Returns matching lines with N lines of surrounding context (configurable).

listAxonCategories / listAxonPatterns / getAxonPattern / getAxonExample

Browse by category or fetch a specific function by ID or name.

Function analysis

Tools that reason about how functions relate to each other.

findFunctionUsage

Every call site for a given function, with file path and line number.

getFunctionExamples

Real-world usage examples drawn from the indexed codebase — useful when the function's own documentation is thin.

getFunctionCallGraph

The caller/callee graph rooted at one function, to configurable depth.

getFunctionUsageStats

Usage counts across the codebase. Unused functions, over-used functions, and coupling metrics.

Code generation and validation

Tools that write and check code.

generateAxonCode

Template-driven generation. 33 curated YAML templates cover HVAC sequences, energy calculations, fault detection, and data aggregation. Output is validated before being returned.

validateAxonCode

Runs three passes: semantic checking (does it parse? are identifiers valid?), performance analysis, and best-practices linting.

parseAxonAst

Parse an Axon expression into an AST. Useful for building higher-level tooling on top of the server.

executeAxonCode

Evaluate an Axon expression against the primary SkySpark project. Returns the result as Haystack grid JSON.

commitAxonFunction

Commit a function to the primary project. With functionVersioning on, the previous revision is preserved.

SkySpark integration

Tools for talking to a live SkySpark instance.

queryHaystack

Execute a Haystack query (read, readAll, history, etc.) and return the result grid.

listSkySparkProjects / switchSkySparkProject

Enumerate projects on the configured instance, and change the active project context for subsequent calls.

discoverProjectFunctions / discoverInstanceProjects

Walk the instance's configured projects, sync their user-defined functions into the local index, and make them searchable.

getProjectSchema

Return the Haystack schema (tags, markers, defined types) for a project.

setPrimaryProject / getPrimaryProject

Manage the primary project context used by executeAxonCode and commitAxonFunction.

Graph analysis and similarity

Tools built on top of the code graph and the vector embedding store.

getCallers / getCallees

Direct neighbours in the call graph — who calls X and what X calls.

getCodeImpact

Blast-radius analysis. Given a function, return every downstream function that would be affected by a change to it.

findCodePath

Shortest call path between two functions. Handy for tracing how a leaf function gets reached from the entry point.

semanticCodeSearch

Natural-language queries that return code by meaning. "Find anything that resets daily energy counters at midnight" works even when no code literally contains those words.

findSimilarCode

Vector similarity between a supplied code snippet and the indexed codebase. Useful for deduplication and refactor discovery.

getGraphMetrics / getMostCalledFunctions / getMostComplexFunctions

Betweenness centrality, coupling scores, complexity rankings.

buildProjectGraph / buildProjectEmbeddings / getGraphStats

Maintenance tools for rebuilding and inspecting the indices.

detectCycles

Circular-dependency detection across the call graph.

Error-handling conventions

All tools return a structured error on failure rather than throwing. The error body includes a code (e.g. INDEX_NOT_FOUND, SKYSPARK_UNREACHABLE, INVALID_ARGUMENT) and a human-readable message. Clients should surface the code to end users and log the message for debugging.