Skip to main content
Glama

custom_query

Execute a custom data query on a statistical dataset by specifying dimensions for columns, rows, and filters. Use this tool when predefined selections are insufficient.

Instructions

Execute a custom data query on a dataset (advanced).

IMPORTANT: Prefer get_selection_data() for predefined tables — it is much simpler and more reliable. Use custom_query only when no suitable predefined selection exists.

Caveats:

  • All dataset dimensions must be placed in columns, rows, or table_filters.

  • Datasets with multiple time dimensions (e.g., CasM + CasR + CASRMX) may only work with certain dimension combinations matching predefined selections.

  • Hierarchical territory dimensions may need "filtr" with "urovenHierarchieKod".

Args: dataset_code: Dataset code. dataset_version: Dataset version string from get_dataset(). columns: Column dimensions. Each dict must have "kodDimenze" (str). Optionally add "filtr" with [{"zobrazitPolozky": ["code1","code2"]}]. rows: Row dimensions. Same structure as columns. Use "kodDimenze": "#UKAZATEL" to put indicators as rows. table_filters: Header/filter dimensions. Same structure, but can also include "filtrTabulkyKod" (str) to filter to a single item. max_rows: Max CSV rows to return.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_codeYes
dataset_versionYes
columnsYes
rowsYes
table_filtersNo
max_rowsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, so description carries full burden. It details caveats about dimension placement, multi-time dimension limitations, and hierarchical territory requirements, offering good behavioral insight. Still, it does not explicitly state read-only nature, which would increase transparency.

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?

Well-structured with important note, caveats, and parameter list. Slightly lengthy but each sentence adds value; could be marginally more concise, but overall effective.

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

Completeness5/5

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

Given 6 complex parameters with no schema descriptions, the description covers parameter usage, special values, default, constraints, and output limit, providing adequate context for correct invocation.

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

Parameters5/5

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

Input schema has 0% description coverage; description compensates thoroughly by explaining the structure of column/row/filter objects, special row value '#UKAZATEL', and max_rows default, adding significant meaning beyond bare types.

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?

Description clearly states 'Execute a custom data query on a dataset' and explicitly distinguishes from 'get_selection_data' as an advanced alternative, making purpose and differentiation evident.

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

Usage Guidelines5/5

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

Explicitly advises to prefer get_selection_data for predefined tables and to use custom_query only when no suitable predefined selection exists, providing clear when-to-use and when-not-to-use guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/reloadcz/mcp-csu'

If you have feedback or need assistance with the MCP directory API, please join our Discord server