Skip to main content
Glama
cliwant

mcp-sam-gov

by cliwant

socrata_query

Read-only

Query rows from allowlisted Socrata open-data portals using SODA API. Supports SoQL filters, pagination, and exact total counts for state spend and vendor datasets.

Instructions

Query rows from an allowlisted Socrata/SODA open-data portal (keyless; ~a dozen US state portals + USAC E-rate on one identical API — state spend/checkbook/contract/vendor-payment datasets). Input domain (curated allowlist enum — the SSRF host guard), datasetId (4x4, from socrata_discover_datasets), optional SoQL select/where/order/q, limit (≤1000, def 100), offset, withTotal (def true). HONESTY: SODA's row response has no total, so a count(*) companion supplies an exact totalAvailable; if it fails the rows still return with totalAvailable:null + a note (hasMore is then inferred from page-fill, never a false complete). Genuine-empty ⇒ complete:true/total:0; an outage/400/404 THROWS (never a fake empty). Value fields are strings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoOptional SoQL $q full-text search across the row.
limitNoRows per page ($limit), 1..1000, default 100.
orderNoOptional SoQL $order, e.g. 'amount DESC'.
whereNoOptional SoQL $where filter, e.g. "fiscal_year='2024' AND amount>1000". A bad column ⇒ upstream HTTP 400 ⇒ invalid_input (surfaced, never silent).
domainYesWhich allowlisted Socrata portal to query (curated .gov hosts + USAC E-rate .org; the SSRF host allowlist — no free host). e.g. data.ny.gov, data.texas.gov, data.wa.gov, opendata.usac.org.
offsetNo0-based row offset ($offset) for pagination, default 0.
selectNoOptional SoQL $select (column projection / aggregate), e.g. 'agency,SUM(amount)'.
datasetIdYesThe dataset's Socrata 4x4 id, e.g. 'kwxv-fwze' (from socrata_discover_datasets). Exactly [a-z0-9]{4}-[a-z0-9]{4} (9 chars; no surrounding whitespace).
withTotalNotrue (default) ⇒ issue a count(*) companion query so totalAvailable is exact. false ⇒ skip it (one fewer request); totalAvailable is null and a note discloses results may be truncated at $limit.
Behavior5/5

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

The description goes beyond the annotations (readOnlyHint, openWorldHint) by detailing key behaviors: keyless access, honest total count handling (exact via count query or null with note on failure), error behavior (throws on outage/400/404, never fake empty), and that value fields are strings. This provides extensive behavioral context.

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 comprehensive yet efficiently structured: purpose first, then parameter details, then behavioral honesty note. While lengthy, every sentence adds essential value without redundancy. A slight trim could be possible, but it earns its length.

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

Completeness4/5

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

Given no output schema, the description covers response behavior thoroughly: row response format, total count mechanism, distinction between genuine empty and error, and value types. It also mentions the companion count query and pagination implications. Almost all necessary context is provided.

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?

With 100% schema coverage, the baseline is 3, but the description adds significant value: explains domain as a curated allowlist enum (SSRF guard), datasetId format, each SoQL parameter (select, where, order, q) with examples, limit range (≤1000, default 100), offset, and withTotal behavior (default true, issues count query). This deep explanation compensates well.

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 clearly states the tool queries rows from an allowlisted Socrata/SODA open-data portal, specifically for state spend/checkbook/contract/vendor-payment datasets. It distinguishes from the sibling tool socrata_discover_datasets which provides the required datasetId.

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 explains what inputs are needed (domain, datasetId, optional SoQL parameters) and mentions that datasetId comes from socrata_discover_datasets. It does not explicitly state when not to use the tool, but the specificity of the allowed portals and parameter details provides clear 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/cliwant/mcp-sam-gov'

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