Skip to main content
Glama

Run a tenant resource query

cs_admin_query

Run tenant-level resource queries using the admin centre query language and export results to JSON, list, or CSV files.

Instructions

Run a tenant-level resource query (the admin centre's own query language) and optionally write the results to a file as JSON, list or CSV. Runs 'pac admin query' with the active pac auth profile.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory for pac (for project commands: the solution project folder)
queryNoResource query JSON as a string
profileNopac auth profile to run as: the admin account for tenant commands. Defaults to CPS_ADMIN_PROFILE for admin commands and CPS_PAC_PROFILE otherwise, then the active profile. cs_init lists the profiles.
queryFileNoFile containing the query JSON
backgroundNoRun in the background and return a jobId immediately, for a command that takes longer than the client will wait. Poll cs_job_status.
outputFileNoWhere to save the results
outputTypeNoJson, List or Grid (default Grid)
timeoutSecondsNoDefault 600

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.5

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description is the only source of behavioral disclosure. It does say the tool runs a tenant query, wraps `pac admin query`, uses the active profile, and can write to a file—useful side-effect context. However, it does not explicitly say the operation is read-only, what happens if an output file already exists, or what the tool returns when no file is requested.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is only two sentences and front-loads the core purpose before the optional file-writing behavior. It earns its place and does not spend words on generic detail, though the 'JSON, list or CSV' phrase is a small factual mismatch with the schema enum.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 8 parameters and no output schema, so the schema carries most of the invocation details that the description does not. The description is broadly informative but does not illuminate the actual query-language syntax, provide examples, or explain the return convention for normal vs. background execution.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and each parameter already has meaningful documentation, so the description is not required to add much. The file-format mention is mildly useful but is also somewhat inconsistent with the `outputType` enum, which only lists `Json`, `List`, and `Grid`; `CSV` is not a valid enum value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource—'Run a tenant-level resource query (the admin centre's own query language)'—and names the underlying command `pac admin query`, distinguishing this from the many sibling cs_admin_* tools. It adds useful detail about optional file output and the active auth profile.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance about when to use this tool versus alternatives like `cs_admin_list_environments`, `cs_admin_environment_status`, or the generic `cs_pac` wrapper. The description explains what the tool does, but not when it should be chosen, when it should be avoided, or what the admin-centre query language is for.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools