Skip to main content
Glama
polygon-io

Massive.com MCP Server

query_data

Read-only

Run SQL queries on stored data tables, including full-text search, CTEs, joins, and window functions.

Instructions

Run SQL queries on tables stored via call_api's store_as parameter. Special commands: SHOW TABLES, DESCRIBE , DROP TABLE . Tables auto-expire after 1 hour. Supports CTEs, window functions, JOINs, and ILIKE.

Full-text search: any stored table with TEXT columns is searchable directly via FTS5. Use WHERE {table} MATCH 'query' and ORDER BY rank (lower = better). Numeric columns preserve their types. For long TEXT fields (news body, 10-K risk factors, filings) prefer snippet()/highlight() in SELECT instead of the raw column — full paragraphs can be thousands of tokens each.

Recommended FTS pattern:

  1. Find matches compactly: SELECT rowid, category, bm25({t}) AS score, snippet({t}, 4, '[', ']', '...', 15) AS snip FROM {t} WHERE {t} MATCH 'supply chain OR supplier' ORDER BY rank

  2. Fetch the full body only for rows you need: call query_data again with SELECT supporting_text FROM {t} WHERE rowid IN (2, 7) and max_cell_chars=0.

Output cells over max_cell_chars (default 2000) are truncated with a visible marker; raise or set to 0 to disable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query or special command (SHOW TABLES, DESCRIBE <table>, DROP TABLE <table>)
applyNoList of function steps to post-process query results
max_cell_charsNoTruncate output cells whose string form exceeds this length, appending a '[truncated: N more chars]' marker. Default 2000. Set to 0 to disable (e.g. when fetching the full body of a specific row). Long TEXT columns like SEC filing text can be thousands of tokens each — prefer snippet()/highlight() in the SELECT list when searching.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations indicate readOnlyHint=true and description confirms read-only behavior. Additionally discloses auto-expiry of tables, cell truncation with markers, and FTS5 support, adding valuable context beyond annotations.

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?

Description is well-structured with clear sections: purpose, special commands, features, FTS patterns. Though lengthy, each sentence adds value. Could be slightly more concise but remains effective.

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?

Given the tool's complexity (SQL queries, FTS, truncation), the description provides complete guidance for agent usage, including practical patterns. Output schema exists, so return values need no further explanation.

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% but description adds extra context for `sql` (special commands) and `max_cell_chars` (truncation details, recommendation for snippet/highlight), enhancing understanding.

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?

Clearly states it runs SQL queries on tables stored via call_api's store_as parameter, lists special commands and features, and differentiates from sibling tools call_api and search_endpoints.

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?

Provides explicit usage guidance including SQL queries, special commands, full-text search patterns, and recommendations. Does not explicitly exclude alternatives but the context is clear.

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/polygon-io/mcp_massive'

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