Skip to main content
Glama

socrata-mcp-server

Query DataCanvas Table

socrata_dataframe_query
Read-onlyIdempotent

Run SELECT-only SQL against a DataCanvas table populated by socrata_query_dataset. DuckDB infers types from spilled data, so numeric columns that SODA returned as strings become queryable with numeric comparisons (year > 2020, amount < 500). Only works when CANVAS_PROVIDER_TYPE=duckdb is set. Use socrata_dataframe_describe to see registered tables and their schemas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSELECT-only SQL to run against registered canvas tables. DDL, DML, and file-reading functions are rejected. Use table names from socrata_dataframe_describe.
limitNoMax rows to return (1–10000). Default 1000.
canvas_idYesCanvas ID returned from socrata_query_dataset or socrata_dataframe_describe.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
capNoThe row limit that was applied when capped.
sqlNoSQL that was executed.
rowsNoQuery result rows. DuckDB may return native JS types (number, boolean, null) for numeric/boolean columns.
errorNoPresent when the call failed. Absent on success.
shownNoRows returned in this response when capped.
noticeNoGuidance when the SQL returned zero rows. Absent when rows are present.
canvas_idNoCanvas ID queried.
row_countNoNumber of rows returned.
truncatedNoTrue when results were capped at the limit — more rows match the query.

TDQS

A4.7/5.0
Behavior5/5

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

Despite readOnlyHint and idempotentHint annotations, the description adds real behavioral value: it explains DuckDB's type inference, the numeric-comparison benefit, the CANVAS_PROVIDER_TYPE=duckdb requirement, and the fact that this is a local table query over spilled data. This goes well beyond what annotations communicate.

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?

Four sentences, each carrying distinct value: purpose, type behavior, environment prerequisite, and schema-discovery pointer. No filler or repeated schema information.

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 and a fully documented input schema, the description covers the essential operational context: what kind of SQL is allowed, how to find table names, the environment prerequisite, and the type-inference behavior. Nothing critical is missing for an agent to invoke this 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?

The schema already covers all three parameters at 100% coverage, so the baseline is 3. The description adds meaningful semantic context for the sql parameter by explaining type coercion behavior with concrete examples (year > 2020, amount < 500), which helps an agent write effective queries.

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 and resource: "Run SELECT-only SQL against a DataCanvas table." It also distinguishes itself from socrata_query_dataset by noting the table is populated by that tool, making the query-layer role clear to an agent.

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 clear context: use this after socrata_query_dataset has populated a table, use socrata_dataframe_describe to inspect registered tables, and only use it when CANVAS_PROVIDER_TYPE=duckdb is set. It does not explicitly contrast with every sibling alternative, but the workflow guidance is strong.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool has a distinct role: discovery (list_portals), search (find_datasets), metadata (get_dataset), query (query_dataset), and post-query analysis (dataframe_describe and dataframe_query). The only potential overlap is between find_datasets and get_dataset, but they are clearly separated by preview vs full schema.

Naming Consistency5/5

All tools follow a consistent 'socrata_<verb>_<noun>' pattern (e.g., socrata_find_datasets, socrata_get_dataset). The dataframe tools extend with a clear prefix (socrata_dataframe_describe/query), maintaining the pattern and clarity.

Tool Count5/5

With 6 tools, the server covers the full discovery-to-query workflow without excess. Each tool serves a necessary step in the pipeline, from portal selection to result analysis, and the count feels well-scoped for a data access tool.

Completeness5/5

The surface covers the entire lifecycle: discover portals, search datasets, fetch metadata, execute queries, and handle large results via DataCanvas spill. There are no obvious gaps for the stated purpose of querying Socrata open-data portals.