actual_query_run
Execute SQL queries for advanced financial data analysis. RECOMMENDED: Use SQL syntax - Most reliable and well-tested format. SQL SYNTAX (Preferred): SELECT [fields] FROM [table] WHERE [conditions] ORDER BY [field] DESC LIMIT [n] Examples: •
This record as markdown: /tools/actual/actual-query-run.md
What actual_query_run does on Actual
AI agents invoke actual_query_run to trigger actions in Actual. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
Why actual_query_run is rated High
This tool executes raw SQL queries against a financial database. While framed as 'analysis,' arbitrary SQL execution can include DDL/DML statements (DROP, DELETE, UPDATE) that are destructive or data-modifying. Even if read-only, the blast radius is critical due to the financial context and the broad attack surface of arbitrary SQL execution. Ranked Execute (bordering Destructive) with critical severity.
From the tool's definition "Execute SQL queries" — the tool explicitly runs arbitrary SQL against financial data, including potentially destructive statements like DROP or DELETE
Attacks that exploit this kind of access
The rule that runs actual_query_run safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Actual, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For actual_query_run, this is the rule to start with:
actual_query_run stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Actual, apply this rule, and every actual_query_run call is checked against it from then on.
Questions about actual_query_run
Execute SQL queries for advanced financial data analysis. RECOMMENDED: Use SQL syntax - Most reliable and well-tested format. SQL SYNTAX (Preferred): SELECT [fields] FROM [table] WHERE [conditions] ORDER BY [field] DESC LIMIT [n] Examples: •. It is categorised as a Execute tool in the Actual MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
Register the Actual MCP server in PolicyLayer and add a rule for actual_query_run: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Actual. Nothing to install.
actual_query_run is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the actual_query_run rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for actual_query_run. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
actual_query_run is provided by the Actual MCP server (actual-mcp-server). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Actual, and thousands of servers like it.
Across the catalogue