Skip to main content
Glama
xmpuspus

ph-civic-data-mcp

by xmpuspus

Summarize infrastructure spending

summarize_infra_spending
Read-onlyIdempotent

Aggregate Philippine infrastructure procurement statistics from PhilGEPS to summarize spending by category, region, and top agencies, with filters for year and region.

Instructions

Aggregate infrastructure procurement statistics over the latest PhilGEPS window.

This tool aggregates the same infra-keyword-matched notice window search_infra_projects reads (cached 6h). rules_evaluated names which breakdowns ran, today by_category and by_region. rules_not_computable names by_funding_source, retired to an always-empty dict because PhilGEPS notices carry no funding source field. sample_size and sufficient_for_per_capita flag whether the window, today under the 500-notice threshold, is large enough for a per-100k rate. Examples:

summarize_infra_spending() summarize_infra_spending(region="ncr", year=2025)

On failure: data_status "unavailable", upstream_error true, totals zero and by_category/by_region/top_agencies empty, with the real PhilGEPS error in caveats. No validation_error path exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoFilter publish date to this calendar year. Drops an undated record and notes the dropped count in caveats.
regionNoPH region filter (partial match).
funding_sourceNoReserved for future DPWH integration; PhilGEPS notices do not expose funding source, so this filter is a no-op today.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • changedInput schema / properties / year / description
      Previous value: -"Filter publish date to this calendar year."New value: +"Filter publish date to this calendar year. Drops an\nundated record and notes the dropped count in caveats."
  2. Addedv0.4.0

TDQS

A4.7/5.0
Behavior5/5

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

It discloses metadata behaviors not in annotations: a 6-hour cache, the per-capita sufficiency threshold, the fact that an undated record is dropped, and the exact failure shape (unavailable/upstream_error/real error in caveats). It also calls out the no-op funding_source behavior and retired breakdown. This goes well beyond what readOnlyHint/openWorldHint/idempotentHint tell the agent.

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 moderately long but front-loads the single-line purpose and follows with dense, high-value detail: caching, computable breakdowns, failure shape, and examples. There is no filler or tautology.

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?

The tool is simple (0 required params, output schema available) and the description covers relevant call dynamics: filtering options, cache freshness, not-enough-data behavior, and failure shape. No additional information seems necessary for an agent to invoke or interpret the tool.

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?

With 100% schema coverage, the schema already describes year and region well and calls funding_source a no-op. The description adds value by showing call examples, clarifying that by_funding_source output will be empty, and linking parameters to output behavior (e.g., undated record dropped in caveats).

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 action and resource ('Aggregate infrastructure procurement statistics over the latest PhilGEPS window') and then explicitly ties itself to the same notice window as search_infra_projects, which separates it from that search-oriented sibling. It identifies focus on aggregate infra spending, a distinct purpose from the broader procurement and project-list tools.

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 establishes clear usage context: agent should use it to get aggregate infrastructure statistics over the cached PhilGEPS window, with examples showing valid calls (region='ncr', year=2025). It does not explicitly name when-not-to-use or alternatives, but the connection to search_infra_projects and the aggregate-vs-raw distinction is clear enough to guide selection.

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