Skip to main content
Glama
xmpuspus

ph-civic-data-mcp

by xmpuspus

Flag infrastructure spending anomalies

flag_infra_anomalies
Read-onlyIdempotent

Flag infrastructure projects for review by cross-referencing Philippine procurement, earthquake, and typhoon data.

Instructions

Flag PhilGEPS infrastructure projects that warrant further review by cross-referencing PHIVOLCS earthquakes and PAGASA typhoon footprints.

This tool emits heuristic anomaly indicators, not accusations. Every flagged item ships with the rule that fired and a disclaimer noting that patterns may have legitimate explanations.

Heuristic rules:

  • duplicate_titles_same_agency: same agency files multiple notices with effectively identical titles (case-insensitive) within the window

  • high_cost_no_published_progress: cost_php exceeds min_cost_php. The PhilGEPS open listing publishes no progress data for ANY notice, so this is a cost-threshold transparency flag, not a project-specific "progress is missing" finding.

  • hazard_overlap: project location keywords overlap with a recent PHIVOLCS earthquake (>=M4.0 in last 30d) or an active PAGASA typhoon footprint, suggesting urgency or post-disaster reconstruction context. Examples:

    flag_infra_anomalies() flag_infra_anomalies(min_cost_php=100_000_000)

On failure: this tool never raises. data_status is "success" when PhilGEPS, PHIVOLCS, and PAGASA all load, "indeterminate" when one or two fail, and "unavailable" when all three fail; upstream_error is true for the last two. A failed sub-call shows up as a caveats entry naming the source, and the flagged list still returns data from every source that did respond.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoPH region filter for the project list.
provinceNoProvince filter (partial match).
min_cost_phpNoThreshold for the high_cost_no_published_progress rule (default 50,000,000 PHP).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • changedInput schema / properties / min_cost_php / description
      Previous value: -"Threshold for the high_cost_no_progress rule\n          (default 50,000,000 PHP)."New value: +"Threshold for the high_cost_no_published_progress rule\n          (default 50,000,000 PHP)."
  2. Addedv0.4.0

TDQS

A4.6/5.0
Behavior5/5

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

The description is unusually explicit about behavior: it never raises, defines data_status values for all failure combinations, explains upstream_error and caveats entries, and notes that partial results still return. It also clarifies that high_cost_no_published_progress is a transparency flag, not a true missing-progress finding, preventing misinterpretation.

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 well organized with separate rule and failure sections, but the 'Examples:' block and repeated explanations make it slightly longer than necessary. Still, every sentence carries useful information and the structure is scannable.

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?

For a read-only analysis tool, the description covers all key contextual aspects: rule logic, default thresholds, filtering options, failure states, partial results, and return semantics. Since an output schema is indicated, return fields need not be enumerated in prose.

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?

The input schema already fully describes region, province, and min_cost_php with defaults. The description adds meaningful rule context for min_cost_php and shows example values, though it adds little beyond schema for region/province filters.

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 immediately identifies the tool's purpose: flag PhilGEPS infrastructure projects for further review by cross-referencing PHIVOLCS earthquakes and PAGASA typhoons. It clearly names the three heuristic rules and explicitly frames outputs as indicators, not accusations, so an agent knows what the tool is for.

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?

It gives concrete invocation examples and explains when each rule fires, including the default threshold. It doesn't explicitly contrast with sibling tools like search_infra_projects or assess_area_risk, but the purpose and failure semantics are clear enough for appropriate use.

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