Skip to main content
Glama
OctagonAI

mcp-octagon

Official
by OctagonAI

octagon-scraper-agent

Extract structured financial data from investor relations websites and online sources for investment research when APIs are unavailable.

Instructions

[PUBLIC & PRIVATE MARKET INTELLIGENCE] Specialized agent for financial data extraction from investor websites. Capabilities: Extract structured financial data from investor relations websites, tables, and online financial sources. Best for: Gathering financial data from websites that don't have accessible APIs. Example queries: 'Extract all data fields from zillow.com/san-francisco-ca/', 'Extract all data fields from www.carvana.com/cars/'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesYour natural language query or request for the agent

Implementation Reference

  • Handler function that invokes the Octagon 'octagon-scraper-agent' model via OpenAI-compatible client, processes the streaming chat completion response, and returns the formatted text content or error.
    async ({ prompt }: PromptParams) => {
      try {
        const response = await octagonClient.chat.completions.create({
          model: "octagon-scraper-agent",
          messages: [{ role: "user", content: prompt }],
          stream: true,
          metadata: { tool: "mcp" }
        });
    
        const result = await processStreamingResponse(response);
        return {
          content: [
            {
              type: "text",
              text: result,
            },
          ],
        };
      } catch (error) {
        console.error("Error calling Scraper agent:", error);
        return {
          isError: true,
          content: [
            {
              type: "text",
              text: `Error: Failed to process web scraping query. ${error}`,
            },
          ],
        };
      }
    }
  • Input schema defining the 'prompt' parameter for the tool.
      prompt: z.string().describe("Your natural language query or request for the agent"),
    },
  • src/index.ts:128-165 (registration)
    MCP server tool registration for 'octagon-scraper-agent', including name, description, schema, and handler reference.
    server.tool(
      "octagon-scraper-agent",
      "[PUBLIC & PRIVATE MARKET INTELLIGENCE] Specialized agent for financial data extraction from investor websites. Capabilities: Extract structured financial data from investor relations websites, tables, and online financial sources. Best for: Gathering financial data from websites that don't have accessible APIs. Example queries: 'Extract all data fields from zillow.com/san-francisco-ca/', 'Extract all data fields from www.carvana.com/cars/'.",
      {
        prompt: z.string().describe("Your natural language query or request for the agent"),
      },
      async ({ prompt }: PromptParams) => {
        try {
          const response = await octagonClient.chat.completions.create({
            model: "octagon-scraper-agent",
            messages: [{ role: "user", content: prompt }],
            stream: true,
            metadata: { tool: "mcp" }
          });
    
          const result = await processStreamingResponse(response);
          return {
            content: [
              {
                type: "text",
                text: result,
              },
            ],
          };
        } catch (error) {
          console.error("Error calling Scraper agent:", error);
          return {
            isError: true,
            content: [
              {
                type: "text",
                text: `Error: Failed to process web scraping query. ${error}`,
              },
            ],
          };
        }
      }
    );
  • Shared helper function to process streaming responses from the Octagon API, aggregating content from chat completions or responses API chunks. Used by the tool handler.
    async function processStreamingResponse(stream: any): Promise<string> {
      let fullResponse = "";
      let citations: any[] = [];
    
      try {
        // Process the streaming response
        for await (const chunk of stream) {
          // For Chat Completions API
          if (chunk.choices && chunk.choices[0]?.delta?.content) {
            fullResponse += chunk.choices[0].delta.content;
    
            // Check for citations in the final chunk
            if (chunk.choices[0]?.finish_reason === "stop" && chunk.choices[0]?.citations) {
              citations = chunk.choices[0].citations;
            }
          }
    
          // For Responses API
          if (chunk.type === "response.output_text.delta") {
            fullResponse += chunk.text?.delta || "";
          }
        }
    
        return fullResponse;
      } catch (error) {
        console.error("Error processing streaming response:", error);
        throw error;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral disclosure. It mentions 'financial data extraction' but doesn't describe rate limits, authentication needs, error handling, or what happens when extraction fails. The description doesn't contradict annotations since none exist, but it's insufficient for a tool performing web scraping operations.

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 reasonably concise with three focused sentences: purpose statement, capabilities, usage guidance, and examples. The bracketed '[PUBLIC & PRIVATE MARKET INTELLIGENCE]' adds some noise, but overall the structure is clear and front-loaded with the core purpose.

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?

For a web scraping tool with no annotations and no output schema, the description is incomplete. It doesn't explain what structured data format to expect, error conditions, rate limits, or authentication requirements. The examples help but don't compensate for missing behavioral and output information critical for an AI agent.

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?

The description doesn't mention the 'prompt' parameter at all, though schema description coverage is 100% with the parameter well-documented as 'Your natural language query or request for the agent'. The description's example queries imply what the prompt should contain, but adds minimal value beyond what the schema already provides.

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 as 'financial data extraction from investor websites' with specific capabilities like extracting structured data from tables and online financial sources. It distinguishes from siblings by specifying 'financial data' focus, though not explicitly contrasting with 'octagon-agent' or 'octagon-deep-research-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?

The description provides clear context for when to use this tool: 'Best for: Gathering financial data from websites that don't have accessible APIs.' It gives two example queries showing practical applications. However, it doesn't explicitly state when NOT to use it or mention alternatives among sibling tools.

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/OctagonAI/octagon-mcp-server'

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