Skip to main content
Glama
ClawyPro

Clawy MCP Server

by ClawyPro

finnhub_query

Query real-time financial data from Finnhub to access stock quotes, company news, earnings, recommendations, and market status for investment analysis.

Instructions

Query real-time financial data from Finnhub. Stock quotes, company news, earnings, recommendations, and market status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYesFinnhub endpoint (e.g., quote, company-news, recommendation, earnings)
symbolNoStock symbol (e.g., AAPL, MSFT)
fromNoStart date (YYYY-MM-DD) for news/earnings
toNoEnd date (YYYY-MM-DD)

Implementation Reference

  • The handler for the `finnhub_query` tool is dynamically registered in `src/index.ts`. It utilizes `gatewayRequest` to perform the action based on the tool's endpoint defined in `src/tools/finnhub.ts`.
    server.tool(
      tool.name,
      tool.description,
      tool.inputSchema.shape,
      async (params) => {
        const method = tool.method || "POST";
        const result = await gatewayRequest(method, tool.endpoint, params as Record<string, unknown>);
    
        if (result.error) {
          return {
            content: [{ type: "text" as const, text: `Error (${result.status}): ${result.error}` }],
            isError: true,
          };
        }
    
        const text = typeof result.data === "string"
          ? result.data
          : JSON.stringify(result.data, null, 2);
    
        return {
          content: [{ type: "text" as const, text }],
        };
      },
    );
  • Schema definition for the input arguments required by the `finnhub_query` tool.
    inputSchema: z.object({
      endpoint: z.string().describe("Finnhub endpoint (e.g., quote, company-news, recommendation, earnings)"),
      symbol: z.string().optional().describe("Stock symbol (e.g., AAPL, MSFT)"),
      from: z.string().optional().describe("Start date (YYYY-MM-DD) for news/earnings"),
      to: z.string().optional().describe("End date (YYYY-MM-DD)"),
    }),
  • Registration of the `finnhub_query` tool definition, including its name, description, schema, and API endpoint.
    {
      name: "finnhub_query",
      description: "Query real-time financial data from Finnhub. Stock quotes, company news, earnings, recommendations, and market status.",
      inputSchema: z.object({
        endpoint: z.string().describe("Finnhub endpoint (e.g., quote, company-news, recommendation, earnings)"),
        symbol: z.string().optional().describe("Stock symbol (e.g., AAPL, MSFT)"),
        from: z.string().optional().describe("Start date (YYYY-MM-DD) for news/earnings"),
        to: z.string().optional().describe("End date (YYYY-MM-DD)"),
      }),
      endpoint: "/v1/finnhub/query",
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'real-time' data but doesn't disclose rate limits, authentication needs, data freshness, error handling, or response formats. For a financial API tool with no annotation coverage, this leaves significant behavioral gaps.

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 appropriately sized (two sentences) and front-loaded with the core purpose. Every sentence adds value: the first states the action and source, the second lists data types. No wasted words, though it could be slightly more structured.

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

Completeness2/5

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

Given no annotations, no output schema, and a general-purpose financial query tool, the description is incomplete. It lacks information on response structure, error conditions, rate limits, and differentiation from sibling tools. The agent would need to guess or trial-and-error.

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%, so the schema already documents all 4 parameters. The description adds no parameter-specific information beyond implying 'symbol' is for stocks and 'from/to' for date ranges. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Query real-time financial data from Finnhub' with specific examples of data types (stock quotes, company news, earnings, recommendations, market status). It uses a specific verb ('query') and identifies the resource ('Finnhub'), but doesn't distinguish from sibling financial tools like alpha_vantage_query or fmp_financial.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling financial tools like alpha_vantage_query or fmp_financial, nor does it specify any prerequisites, constraints, or typical use cases. The agent must infer usage from the description alone.

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/ClawyPro/clawy-mcp-server'

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