Skip to main content
Glama
xmpuspus

ph-civic-data-mcp

by xmpuspus

Query a PSA OpenSTAT dataset

query_psa_dataset
Read-onlyIdempotent

Query Philippine Statistics Authority datasets by specifying explicit value codes for every dimension, preventing HTTP 403 errors from unselected dimensions.

Instructions

Run one bounded query against a PSA OpenSTAT dataset.

Every dimension needs an explicit list of value codes from describe_psa_dataset. That is a hard requirement, not a convention: PXWeb expands an unselected dimension to all of its values, and PSA answers the resulting full-cube request with an HTTP 403.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_rowsNoCap on returned rows (1-5000, default 500).
selectionsYesDimension code -> list of value codes, covering every dimension the dataset declares. "all" and "*" are rejected. Example: {"Year": ["2"], "Major Island Group": ["0", "2"], "Among Families/Population": ["0"]}.
dataset_pathYesRelative `.px` path, e.g. "1F/FY/0241F3DF013.px".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
rowsYes
titleNo
sourceYesUpstream data source name.
caveatsYes
licenseNo
row_countYes
truncatedNo
disclaimerNo
source_urlYesCanonical OpenSTAT URL used.
dataset_pathYes
upstream_errorNoTrue when OpenSTAT was unreachable. Not an empty result.
requested_cellsNo
reference_periodNoData vintage read from the table's own time dimension.
validation_errorNoTrue when the caller's arguments were rejected before any request.
data_retrieved_atYes
total_rows_availableNo
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint. The description adds a critical behavioral warning: PXWeb expands unselected dimensions and PSA returns HTTP 403 for full-cube requests. This goes beyond annotations by explaining a failure mode and the reason for the strict requirement.

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?

Two sentences, immediately front-loaded with the purpose. Every clause adds critical information: bounded query, need for explicit codes, failure mode. No fluff.

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?

With an output schema present, return values don't need description. The tool has only 3 parameters, and the description covers its essential behavior, the companion tool to use first, and the key failure condition. It is self-contained and sufficient for an agent to invoke correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds value by emphasizing that selections must cover every dimension and pointing to describe_psa_dataset as the source of valid value codes. This supplements the schema and helps the agent construct correct selections.

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 'Run one bounded query against a PSA OpenSTAT dataset,' which names a specific verb and resource. It clearly differentiates from siblings like browse_psa_catalog and describe_psa_dataset by focusing on query execution against a dataset.

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

Usage Guidelines4/5

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

The description gives concrete guidance: 'Every dimension needs an explicit list of value codes from describe_psa_dataset.' It also frames this as a hard requirement, telling the agent to first call describe_psa_dataset. It stops short of explicitly naming alternatives or exclusions, so it doesn't earn a 5.

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/xmpuspus/ph-civic-data-mcp'

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