run_query
Use this when the user wants to analyze cloud costs, generate a cost breakdown, view spending trends, or run a custom analytics query across their cloud providers. Runs the config through the DoiT Cloud Analytics API query endpoint (https://developer.doit.com/reference/query) and returns the resu...
This record as markdown: /tools/doit/run-query.md
What run_query does on Doit
AI agents invoke run_query to trigger actions in Doit. 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
config | object | Yes | Configuration for the query. Valid dimension IDs come from list_dimensions or get_dimension. |
Parameters from the server's own tool schema.
Why run_query is rated High
run_query triggers real processes with real consequences. An agent gone sideways doesn't fire it once. It starts dozens of builds, sends mass notifications, or burns through compute before anyone looks up.
Risk signalsHigh parameter count (73 properties)
Attacks that exploit this kind of access
The rule that runs run_query safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Doit, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For run_query, this is the rule to start with:
run_query 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 Doit, apply this rule, and every run_query call is checked against it from then on.
Questions about run_query
Use this when the user wants to analyze cloud costs, generate a cost breakdown, view spending trends, or run a custom analytics query across their cloud providers. Runs the config through the DoiT Cloud Analytics API query endpoint (https://developer.doit.com/reference/query) and returns the result rows. Accepts a structured config with data source, metrics, dimensions, time range, and filters. Do NOT use this for listing saved reports (use list_reports), checking anomalies (use get_anomalies), or viewing budgets (use list_budgets). Unpopulated fields take API defaults: basic cost, last 7 days including today, daily time rows (year/month/day), and billing (or billing-datahub for customers with DataHub metrics). Each config.group[].limit.value selects top/bottom N dimension values per parent group, ranked across the range; it does not cap result rows and has no tool-enforced maximum of 25. Time columns can produce multiple rows per group. timeRange covers relative periods; explicit dates require timeRange: {mode: "custom"} and sibling config.customTimeRange: {from, to}, with no unit. For mode "last", "includeCurrent": true includes the current partial period within amount; false selects fully completed periods. One month with true is current month-to-date. "metrics" (array) supersedes the deprecated "metric" (object). A "group" with id "service_description" and type "fixed" returns a per-service cost breakdown, the most common shape for cost questions. Common grouping dimension IDs (all type "fixed"): "service_description" — cloud service "project_id" — GCP project / AWS account / Azure subscription "cloud_provider" — cloud provider (AWS / GCP / Azure) In default mode "is", filter values must exactly match stored dimension values (case-sensitive): cloud_provider uses provider IDs, while service_description uses service names. Common cloud-provider aliases such as aws/gcp/azure are normalized by run_query. get_dimension({type, id}) returns the valid values for a dimension for this customer. Known cloud provider IDs (cloud_provider, type "fixed"): "amazon-web-services" = AWS, "google-cloud" = GCP, "microsoft-azure" = Azure Example — top AWS services last month: { "config": { "dataSource": "billing", "metrics": [{"type": "basic", "value": "cost"}], "timeRange": {"mode": "last", "amount": 1, "unit": "month", "includeCurrent": false}, "filters": [{"id": "cloud_provider", "type": "fixed", "values": ["amazon-web-services"]}], "group": [{"id": "service_description", "type": "fixed", "limit": {"metric": {"type": "basic", "value": "cost"}, "sort": "desc", "value": 10}}] } }. It is categorised as a Execute tool in the Doit MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
run_query accepts 1 parameter: config. Required: config. The full parameter table on this page comes from the server's own tool schema.
Register the Doit MCP server in PolicyLayer and add a rule for run_query: 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 Doit. Nothing to install.
run_query 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 run_query 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 run_query. 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.
run_query is provided by the Doit MCP server (@doitintl/doit-mcp-server). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Doit, and thousands of servers like it.
This server
Across the catalogue