Skip to main content
Glama

Get SEC Filing

get_sec_filing

Retrieve an SEC filing by its accession number. Get filing metadata including company info, form type, filing date, and document URLs.

Instructions

Retrieve a single SEC filing by its accession number. Returns full filing metadata including company info, form type, filing date, and document URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accession_numberYesSEC accession number (e.g. 0001652044-25-000001). Dashes are optional.

Implementation Reference

  • Handler function for the get_sec_filing tool. Takes an accession_number parameter, makes a GET request to /api/v1/sec/filings/{accession_number}, and returns the filing data as JSON. Handles 404 and other error cases.
    server.registerTool(
      "get_sec_filing",
      {
        title: "Get SEC Filing",
        description:
          "Retrieve a single SEC filing by its accession number. Returns full filing metadata " +
          "including company info, form type, filing date, and document URLs.",
        inputSchema: {
          accession_number: z
            .string()
            .describe(
              "SEC accession number (e.g. 0001652044-25-000001). Dashes are optional.",
            ),
        },
      },
      async ({ accession_number }) => {
        const res = await apiGet<SecFilingResponse>(
          `/api/v1/sec/filings/${encodeURIComponent(accession_number)}`,
        );
    
        if (!res.ok) {
          const msg =
            res.status === 404
              ? `Filing ${accession_number} not found.`
              : `API error (${res.status}): ${JSON.stringify(res.data)}`;
          return {
            content: [{ type: "text" as const, text: msg }],
            isError: res.status !== 404,
          };
        }
    
        return {
          content: [
            { type: "text" as const, text: JSON.stringify(res.data.data, null, 2) },
          ],
        };
      },
  • TypeScript interface defining the response shape for the get_sec_filing API call.
    interface SecFilingResponse {
      dataset: string;
      data: Record<string, unknown>;
    }
  • The registerSecTools function registers all SEC-related tools on the MCP server, including get_sec_filing.
    export function registerSecTools(server: McpServer): void {
      // ── Search filings ───────────────────────────────────────────────────────
    
      server.registerTool(
        "search_sec_filings",
        {
          title: "Search SEC Filings",
          description:
            "Search SEC EDGAR filings by CIK number, form type (10-K, 10-Q, 8-K, etc.), " +
            "company name, and date range. Returns filing metadata including accession number, " +
            "filing date, and document URLs. Source: SEC EDGAR, updated every 15 minutes.",
          inputSchema: {
            cik: z
              .string()
              .optional()
              .describe(
                "Central Index Key — SEC's unique company identifier (e.g. 0001652044 for Alphabet)",
              ),
            form_type: z
              .string()
              .optional()
              .describe(
                "SEC form type (e.g. 10-K, 10-Q, 8-K, S-1, DEF 14A). Case-insensitive.",
              ),
            company_name: z
              .string()
              .optional()
              .describe("Company name to search for (partial match)"),
            date_from: z
              .string()
              .optional()
              .describe("Start date for filing date range (YYYY-MM-DD)"),
            date_to: z
              .string()
              .optional()
              .describe("End date for filing date range (YYYY-MM-DD)"),
            limit: z
              .number()
              .int()
              .min(1)
              .max(100)
              .optional()
              .describe("Maximum number of results (default 25, max 100)"),
          },
        },
        async ({ cik, form_type, company_name, date_from, date_to, limit }) => {
          const res = await apiGet<SecFilingsResponse>("/api/v1/sec/filings", {
            cik,
            form_type,
            company_name,
            date_from,
            date_to,
            limit: limit ?? 25,
          });
    
          if (!res.ok) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
                },
              ],
              isError: true,
            };
          }
    
          const { count, data } = res.data;
          const summary = `Found ${count} SEC filing(s).`;
          const json = JSON.stringify(data, null, 2);
    
          return {
            content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
          };
        },
      );
    
      // ── Single filing lookup ─────────────────────────────────────────────────
    
      server.registerTool(
        "get_sec_filing",
        {
          title: "Get SEC Filing",
          description:
            "Retrieve a single SEC filing by its accession number. Returns full filing metadata " +
            "including company info, form type, filing date, and document URLs.",
          inputSchema: {
            accession_number: z
              .string()
              .describe(
                "SEC accession number (e.g. 0001652044-25-000001). Dashes are optional.",
              ),
          },
        },
        async ({ accession_number }) => {
          const res = await apiGet<SecFilingResponse>(
            `/api/v1/sec/filings/${encodeURIComponent(accession_number)}`,
          );
    
          if (!res.ok) {
            const msg =
              res.status === 404
                ? `Filing ${accession_number} not found.`
                : `API error (${res.status}): ${JSON.stringify(res.data)}`;
            return {
              content: [{ type: "text" as const, text: msg }],
              isError: res.status !== 404,
            };
          }
    
          return {
            content: [
              { type: "text" as const, text: JSON.stringify(res.data.data, null, 2) },
            ],
          };
        },
      );
    
      // ── Company search ───────────────────────────────────────────────────────
    
      server.registerTool(
        "search_sec_companies",
        {
          title: "Search SEC Companies",
          description:
            "Search for companies registered with the SEC by name. Returns CIK numbers, " +
            "company names, and filing counts. Useful for finding a company's CIK before " +
            "searching their filings.",
          inputSchema: {
            search: z
              .string()
              .min(2)
              .describe("Company name to search for (at least 2 characters)"),
          },
        },
        async ({ search }) => {
          const res = await apiGet<SecCompaniesResponse>("/api/v1/sec/companies", {
            search,
          });
    
          if (!res.ok) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
                },
              ],
              isError: true,
            };
          }
    
          const { count, data } = res.data;
          const summary = `Found ${count} compan${count === 1 ? "y" : "ies"}.`;
          const json = JSON.stringify(data, null, 2);
    
          return {
            content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
          };
        },
      );
    
      // ── Dataset stats ────────────────────────────────────────────────────────
    
      server.registerTool(
        "sec_stats",
        {
          title: "SEC Dataset Statistics",
          description:
            "Get statistics about the SEC filings dataset: total filings, form type breakdown, " +
            "date range, and last updated timestamp. Free endpoint, no payment required.",
          inputSchema: {},
        },
        async () => {
          const res = await apiGet<SecStatsResponse>("/api/v1/sec/stats");
    
          if (!res.ok) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
                },
              ],
              isError: true,
            };
          }
    
          return {
            content: [
              { type: "text" as const, text: JSON.stringify(res.data, null, 2) },
            ],
          };
        },
      );
    }
  • src/index.ts:33-61 (registration)
    The createMcpServer function in index.ts calls registerSecTools(server) to register all SEC tools on the MCP server.
    function createMcpServer() {
      const server = new McpServer({
        name: "verilex-data",
        version: "0.3.3",
      });
    
      registerNpiTools(server);
      registerSecTools(server);
      registerPacerTools(server);
      registerWeatherTools(server);
      registerOtcTools(server);
      registerTrademarkTools(server);
      registerPatentTools(server);
      registerCompanyTools(server);
      registerCryptoTools(server);
      registerSanctionsTools(server);
      registerWhaleTools(server);
      registerLabelTools(server);
      registerHolderTools(server);
      registerDexTools(server);
      registerContractTools(server);
      registerPmTools(server);
      registerPmArbTools(server);
      registerPmResolutionTools(server);
      registerEconTools(server);
      registerPmMicroTools(server);
    
      return server;
    }
  • The apiGet helper function used by the get_sec_filing handler to make HTTP GET requests to the Verilex API.
    export async function apiGet<T = unknown>(
      path: string,
      params?: Record<string, string | number | undefined>,
    ): Promise<ApiResponse<T>> {
      const url = buildUrl(path, params);
    
      const headers: Record<string, string> = {
        Accept: "application/json",
        "User-Agent": "verilex-mcp-server/0.1.0",
      };
    
      // Forward x402 payment token if present in env (for paid endpoints)
      const paymentToken = process.env.VERILEX_PAYMENT_TOKEN;
      if (paymentToken) {
        headers["X-Payment-Token"] = paymentToken;
      }
    
      const res = await fetch(url, { headers });
      const data = (await res.json()) as T;
    
      const stale = res.headers.get("X-Data-Stale");
      const lastUpdated = res.headers.get("X-Data-Last-Updated");
      const ageSeconds = res.headers.get("X-Data-Age-Seconds");
    
      return {
        ok: res.ok,
        status: res.status,
        data,
        stale: stale === "true",
        lastUpdated: lastUpdated ?? undefined,
        ageSeconds: ageSeconds ? Number(ageSeconds) : undefined,
      };
    }
Behavior3/5

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

No annotations are provided, so the description must carry the full burden. It discloses that the tool returns metadata and document URLs, which is adequate for a simple read operation, but lacks details on error handling or permissions.

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?

Two sentences are highly concise, with the first stating the core action and resource, and the second listing return contents. No extraneous text.

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 simple retrieval tool with one parameter and no output schema, the description is sufficiently complete. It explains what the tool does and the kind of data returned, though it omits error cases or format specifics.

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 the parameter description (100% coverage), but the tool description adds context about what the retrieved metadata includes (company info, form type, etc.), providing additional meaning beyond the schema.

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 clearly states the action ('Retrieve') and resource ('SEC filing') with the specific identifier ('accession number'), and differentiates from sibling tools like search_sec_filings by emphasizing 'single' filing.

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?

No explicit guidance on when to use this tool versus alternatives such as search_sec_filings or other related tools. The conditions for use are implied but not stated.

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/carrierone/verilexdata-mcp'

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