Skip to main content
Glama
xmpuspus

ph-civic-data-mcp

by xmpuspus

Describe a PSA OpenSTAT dataset

describe_psa_dataset
Read-onlyIdempotent

Retrieve the dimensions and valid value codes of a PSA OpenDataset to inform subsequent queries.

Instructions

Read the dimensions and valid value codes of one PSA OpenSTAT dataset.

Call this before query_psa_dataset. The query tool needs an explicit value code for every dimension, and those codes live here. total_cells is the size of the full cube. A query must select down to max_cells_per_query or fewer, so pick explicit codes per dimension. Examples:

describe_psa_dataset("1F/FY/0241F3DF013.px") dimensions and value codes for one table

On failure: data_status is "invalid_request" for a rejected argument and "unavailable" for an OpenSTAT outage. A path that is not a .px dataset sets validation_error true before any request goes out. An unreadable dataset sets upstream_error true, with the real error in caveats. Both return an empty dimensions list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_pathYesRelative path to a `.px` dataset, for example "1F/FY/0241F3DF013.px". Take it from the `path` field of a browse_psa_catalog dataset entry.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
titleNo
sourceYesUpstream data source name.
caveatsYes
licenseNo
dimensionsYes
source_urlYesCanonical OpenSTAT URL used.
total_cellsNoSize of the full cube.
dataset_pathYes
upstream_errorNoTrue when OpenSTAT was unreachable. Not an empty result.
time_dimensionsNo
validation_errorNoTrue when the caller's arguments were rejected before any request.
data_retrieved_atYes
max_cells_per_queryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • changedInput schema / properties / dataset_path / description
      Previous value: -"Relative path to a `.px` dataset, e.g.\n          \"1F/FY/0011F3DF010.px\". Take it from the `path` field of\n          a browse_psa_catalog dataset entry."New value: +"Relative path to a `.px` dataset, for example\n          \"1F/FY/0241F3DF013.px\". Take it from the `path` field\n          of a browse_psa_catalog dataset entry."
  2. Addedv0.6.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint false. The description adds substantial behavioral detail: failure modes (data_status 'invalid_request' vs 'unavailable'), validation_error for non-.px paths, upstream_error with caveats, and the empty dimensions list on failure. It also mentions total_cells and max_cells_per_query, which are not in annotations. No contradictions.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, then gives usage guidance, a concrete example, and a structured failure-mode explanation. Every sentence adds value; the length is justified by the tool's role as a prerequisite and its multiple edge cases. The structure is logical and easy to parse.

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 that an output schema exists (not shown here but implied by the context signal), the description need not detail return values. It covers the essential calling context (what to do before querying, what the query tool needs), the example path, and all failure modes with their flags. An agent has everything needed to invoke it correctly and interpret outcomes.

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% (the only parameter dataset_path is fully described, including how to get it from browse_psa_catalog). The tool description provides an example but does not add meaning beyond the schema. Per the baseline for high schema coverage, a 3 is appropriate.

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 opens with a specific verb-resource pair: 'Read the dimensions and valid value codes of one PSA OpenSTAT dataset.' It clearly distinguishes itself from sibling tools like query_psa_dataset (which it supports) and browse_psa_catalog (which provides the path). The example further clarifies the exact input format.

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?

The description explicitly states when to use this tool: 'Call this before query_psa_dataset.' It explains why ('The query tool needs an explicit value code for every dimension, and those codes live here') and gives a concrete example. While it doesn't mention when not to use it (e.g., for listing datasets), the guidance is unambiguous for its primary role.

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