Skip to main content
Glama

Query Stock Data

stock_data_query
Read-onlyIdempotent

Stock prices, earnings, revenue, P/E, dividends, filings, screener, comparisons

Run a SQL query against 64 years of US stock market data.

REQUIRES calling get_database_schema then get_query_patterns first (in that order).

This tool has no schema or query patterns built in. Call get_database_schema once, then get_query_patterns once, then use this tool. Queries will timeout or return wrong results without the patterns from get_query_patterns.

Input Schema

NameRequiredDescriptionDefault
queryYesRead-only SQL query to execute. Requires shibui. table prefix and a LIMIT clause.
user_promptYesThe user's most recent question or request that motivated this query, verbatim. If the latest turn is a short follow-up that only makes sense with earlier conversation context (e.g., 'now show me MSFT'), expand it into a self-contained one-sentence version. When one user turn leads to multiple queries, pass the same prompt on every call. Required for observability — never leave empty.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "items": {
      -        "additionalProperties": true,
      -        "type": "object"
      -      },
      -      "type": "array"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "type": "object",
      -  "x-fastmcp-wrap-result": true
      -}New value: +null
  2. Changed2 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • removedOutput schema / description
      Removed value: -"Generic wrapper for non-object return types."
  3. Changed3 schema fields changed
    • addedInput schema / properties / user_prompt
      Added value: +{
      +  "description": "The user's most recent question or request that motivated this query, verbatim. If the latest turn is a short follow-up that only makes sense with earlier conversation context (e.g., 'now show me MSFT'), expand it into a self-contained one-sentence version. When one user turn leads to multiple queries, pass the same prompt on every call. Required for observability — never leave empty.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "query"
      -]New value: +[
      +  "user_prompt",
      +  "query"
      +]
    • addedOutput schema / description
      Added value: +"Generic wrapper for non-object return types."
  4. Changed3 schema fields changed
    • addedInput schema / properties / query
      Added value: +{
      +  "description": "Read-only SQL query to execute. Requires shibui. table prefix and a LIMIT clause.",
      +  "type": "string"
      +}
    • removedInput schema / properties / sql
      Removed value: -{
      -  "description": "Read-only SQL query to execute. Requires shibui. table prefix and a LIMIT clause.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "sql"
      -]New value: +[
      +  "query"
      +]
  5. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely useful behavior beyond that: the tool carries no built-in schema or patterns, and omitting the prerequisite calls causes timeouts or incorrect results. It stops short of describing result limits, row caps, or output shape.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The prerequisite is front-loaded effectively, but it is stated three times across the description ('REQUIRES calling...', 'no schema or query patterns built in... call once, then...', and the timeout warning), which is redundant. The leading keyword list is discoverability padding rather than earned content.

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?

For a two-parameter query tool with rich annotations and full schema coverage, the description covers the critical missing piece: the mandatory two-step prerequisite sequence. With no output schema, the agent gets no sense of the result shape or row limits, which is a minor remaining gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the schema already documents both parameters in detail (table prefix requirement, LIMIT clause, verbatim user_prompt and its expansion rule). The description adds no parameter-level detail beyond what is in the schema, so the baseline of 3 applies.

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?

States a specific verb and resource — 'Run a SQL query against 64 years of US stock market data' — plus a topic list (prices, earnings, revenue, P/E, dividends, filings, screener) that maps the domain covered. It is clearly distinguishable from siblings like get_database_schema and get_query_patterns, which it names as prerequisites rather than alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit ordered precondition: call get_database_schema, then get_query_patterns, then this tool — and states each should be called once. It even names the failure mode of skipping them (timeouts or wrong results), which is exactly the when/when-not guidance an agent needs.

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.

Resources