PromQL — 15 Operations for AI Agents
This page is the canonical reference an AI coding agent uses to refactor, query, and analyze PromQL code through the act MCP server. 15 operations available: 0 refactor, 15 query, 0 analysis. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.
15Query
Query
| Operation | Description |
|---|---|
callers | Find every call site of a function or method across the codebase. Use to understand who depends on a function before changing its signature. Requires LSP. Params: symbol (string) [, file (string)] |
control_flow | Get a function's control flow — branches, loops, early returns, and basic blocks in execution order. Use to understand complex logic without reading the full implementation. Params: target (string), file (string) |
definition | Jump to definition — find where a symbol is defined given a usage location. Uses abstract syntax trees by default, no LSP required. Params: symbol (string), file (string), line (u32), column (u32) |
diagnostics | Get compiler errors and warnings from the language server. Omit `file` for workspace-wide diagnostics. Pass a file path or directory path to scope results. Requires LSP. |
fix_auto | Auto-fix all deterministic issues in a file, directory, or workspace — missing imports, unused imports, simple type errors. Runs multiple fix-revalidate cycles. Use after making changes to clean up automatically. Requires LSP. Params: none [, file (string), workspace_mode (bool), category (string), commit (bool), max_rounds (u32)] |
get_type | Get the compiler-inferred type of any expression at a position. Use to understand types without reading surrounding code. Requires LSP. Params: file (string), line (u32), column (u32) |
graph | Build a dependency graph from a file — trace what it imports and what imports it, across multiple hops. Use to understand module relationships and change impact before refactoring. Params: file (string) [, depth (u32), direction (string), leaves (bool), order (string)] |
import_organize | Organize, sort, and deduplicate imports in a file. Removes unused imports. Use after adding new code or moving symbols to clean up import blocks automatically. Params: file (string) [, preview (bool)] |
interface | Get a symbol's public API — signatures, types, and docstrings without implementation bodies. Like skeleton but for a single symbol. Use to understand how to call something without reading its internals. Params: target (string), file (string) [, include_private (bool)] |
mutations | Identify side effects — what external state a function reads or writes (globals, file I/O, network, etc.). Use to understand if a function is pure or has hidden dependencies. Params: target (string), file (string) |
references | Find every usage of a symbol across the entire codebase — all files, not just the current one. Use before renaming, refactoring, or deleting to understand full impact. Requires LSP. Params: symbol (string), file (string) |
repo_outline | Get a compressed overview of the entire repository in one call — file tree with languages, line counts, and optionally symbol names per file. Orders of magnitude cheaper than listing directories and reading files individually. Params: none [, path (string), depth (u32), include (glob), exclude (glob), symbols (bool), max_files (u32), relative (bool)] |
skeleton | Get a file's structure — function signatures, class declarations, type definitions — without implementation bodies. Use INSTEAD of reading the full file to understand its API. Typically 5-10x fewer tokens than reading the raw file. Params: file (string) |
symbols | List all symbols (functions, classes, variables, types, constants) defined in a file with their locations and kinds. Use INSTEAD of reading a file when you need to know what's defined in it. Much cheaper than reading the full file. IMPORTANT: file must be a path to a single source file — never a directory or empty string. Params: file (string) |
symbols_batch | Retrieve symbols from multiple files in a single call. Use instead of calling symbols() in a loop — one request instead of N. Params: none [, files (string[]), ids (string[]), kinds (string[])] — provide files or ids |