Skip to main content
Glama
imbenrabi

Financial Modeling Prep MCP Server

getCOTReports

Read-onlyIdempotent

Retrieve Commitment of Traders reports to analyze market sentiment by tracking long and short positions for commodities, indices, and financial instruments. Specify symbol and optional date range.

Instructions

Access comprehensive Commitment of Traders (COT) reports with the FMP COT Report API. This API provides detailed information about long and short positions across various sectors, helping you assess market sentiment and track positions in commodities, indices, and financial instruments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesCommodity symbol
from_dateNoOptional start date (YYYY-MM-DD)
toNoOptional end date (YYYY-MM-DD)

Implementation Reference

  • The MCP tool handler for 'getCOTReports' - registers the tool with server.tool(), accepts symbol, from_date, and to parameters, calls cotClient.getReports(), and returns JSON-stringified results or an error.
    server.tool(
      "getCOTReports",
      "Access comprehensive Commitment of Traders (COT) reports with the FMP COT Report API. This API provides detailed information about long and short positions across various sectors, helping you assess market sentiment and track positions in commodities, indices, and financial instruments.",
      {
        symbol: z.string().describe("Commodity symbol"),
        from_date: z
          .string()
          .optional()
          .describe("Optional start date (YYYY-MM-DD)"),
        to: z
          .string()
          .optional()
          .describe("Optional end date (YYYY-MM-DD)"),
      },
      async ({ symbol, from_date: from, to }) => {
        try {
          const results = await cotClient.getReports(symbol, from, to);
          return {
            content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${
                  error instanceof Error ? error.message : String(error)
                }`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Zod schema for the tool's input parameters: symbol (required string), from_date (optional YYYY-MM-DD), to (optional YYYY-MM-DD).
    {
      symbol: z.string().describe("Commodity symbol"),
      from_date: z
        .string()
        .optional()
        .describe("Optional start date (YYYY-MM-DD)"),
      to: z
        .string()
        .optional()
        .describe("Optional end date (YYYY-MM-DD)"),
    },
  • Registration of registerCOTTools via createModuleAdapter('cot', registerCOTTools) in the core module adapters registry.
    import { registerCOTTools } from '../tools/cot.js';
    import { registerESGTools } from '../tools/esg.js';
    import { registerEconomicsTools } from '../tools/economics.js';
    import { registerDCFTools } from '../tools/dcf.js';
    
    export const CORE_MODULE_ADAPTERS: Record<string, ModuleLoader> = {
      search: createModuleAdapter('search', registerSearchTools),
      directory: createModuleAdapter('directory', registerDirectoryTools),
      analyst: createModuleAdapter('analyst', registerAnalystTools),
      calendar: createModuleAdapter('calendar', registerCalendarTools),
      chart: createModuleAdapter('chart', registerChartTools),
      company: createModuleAdapter('company', registerCompanyTools),
      cot: createModuleAdapter('cot', registerCOTTools),
      esg: createModuleAdapter('esg', registerESGTools),
      economics: createModuleAdapter('economics', registerEconomicsTools),
      dcf: createModuleAdapter('dcf', registerDCFTools),
    };
  • COTClient.getReports() - makes the HTTP GET request to '/commitment-of-traders-report' endpoint with symbol, from, to parameters, returning COTReport[].
    async getReports(
      symbol: string,
      from?: string,
      to?: string,
      options?: {
        signal?: AbortSignal;
        context?: FMPContext;
      }
    ): Promise<COTReport[]> {
      return super.get<COTReport[]>("/commitment-of-traders-report", { symbol, from, to }, options);
    }
  • TypeScript interface COTReport defining all fields returned by the COT reports API (symbol, date, name, sector, positions, percentages, concentration data, etc.).
    export interface COTReport {
      symbol: string;
      date: string;
      name: string;
      sector: string;
      marketAndExchangeNames: string;
      cftcContractMarketCode: string;
      cftcMarketCode: string; 
      cftcRegionCode: string;
      cftcCommodityCode: string;
      openInterestAll: number;
      noncommPositionsLongAll: number;
      noncommPositionsShortAll: number;
      noncommPositionsSpreadAll: number;  
      commPositionsLongAll: number;
      commPositionsShortAll: number;
      totReptPositionsLongAll: number;
      totReptPositionsShortAll: number;
      nonreptPositionsLongAll: number;
      nonreptPositionsShortAll: number; 
      openInterestOld: number;
      noncommPositionsLongOld: number;
      noncommPositionsShortOld: number;
      noncommPositionsSpreadOld: number;
      commPositionsLongOld: number;
      commPositionsShortOld: number;  
      totReptPositionsLongOld: number;
      totReptPositionsShortOld: number;
      nonreptPositionsLongOld: number;
      nonreptPositionsShortOld: number;
      openInterestOther: number;
      noncommPositionsLongOther: number;  
      noncommPositionsShortOther: number;
      noncommPositionsSpreadOther: number;
      commPositionsLongOther: number;
      commPositionsShortOther: number;
      totReptPositionsLongOther: number;
      totReptPositionsShortOther: number; 
      nonreptPositionsLongOther: number;
      nonreptPositionsShortOther: number;
      changeInOpenInterestAll: number;
      changeInNoncommLongAll: number;
      changeInNoncommShortAll: number;
      changeInNoncommSpeadAll: number;  
      changeInCommLongAll: number;
      changeInCommShortAll: number;
      changeInTotReptLongAll: number;
      changeInTotReptShortAll: number;
      changeInNonreptLongAll: number;
      changeInNonreptShortAll: number;  
      pctOfOpenInterestAll: number;
      pctOfOiNoncommLongAll: number;
      pctOfOiNoncommShortAll: number;
      pctOfOiNoncommSpreadAll: number;
      pctOfOiCommLongAll: number;
      pctOfOiCommShortAll: number;  
      pctOfOiTotReptLongAll: number;
      pctOfOiTotReptShortAll: number;
      pctOfOiNonreptLongAll: number;
      pctOfOiNonreptShortAll: number;
      pctOfOpenInterestOl: number;
      pctOfOiNoncommLongOl: number; 
      pctOfOiNoncommShortOl: number;
      pctOfOiNoncommSpreadOl: number;
      pctOfOiCommLongOl: number;
      pctOfOiCommShortOl: number;
      pctOfOiTotReptLongOl: number;
      pctOfOiTotReptShortOl: number;  
      pctOfOiNonreptLongOl: number;
      pctOfOiNonreptShortOl: number;
      pctOfOpenInterestOther: number;
      pctOfOiNoncommLongOther: number;
      pctOfOiNoncommShortOther: number;
      pctOfOiNoncommSpreadOther: number;  
      pctOfOiCommLongOther: number;
      pctOfOiCommShortOther: number;
      pctOfOiTotReptLongOther: number;
      pctOfOiTotReptShortOther: number;
      pctOfOiNonreptLongOther: number;
      pctOfOiNonreptShortOther: number; 
      tradersTotAll: number;
      tradersNoncommLongAll: number;
      tradersNoncommShortAll: number;
      tradersNoncommSpreadAll: number;
      tradersCommLongAll: number;
      tradersCommShortAll: number;  
      tradersTotReptLongAll: number;
      tradersTotReptShortAll: number;
      tradersTotOl: number;
      tradersNoncommLongOl: number;
      tradersNoncommShortOl: number;
      tradersNoncommSpeadOl: number;  
      tradersCommLongOl: number;
      tradersCommShortOl: number;
      tradersTotReptLongOl: number;
      tradersTotReptShortOl: number;
      tradersTotOther: number;
      tradersNoncommLongOther: number;  
      tradersNoncommShortOther: number;
      tradersNoncommSpreadOther: number;
      tradersCommLongOther: number;
      tradersCommShortOther: number;
      tradersTotReptLongOther: number;
      tradersTotReptShortOther: number; 
      concGrossLe4TdrLongAll: number;
      concGrossLe4TdrShortAll: number;
      concGrossLe8TdrLongAll: number;
      concGrossLe8TdrShortAll: number;
      concNetLe4TdrLongAll: number;
      concNetLe4TdrShortAll: number;  
      concNetLe8TdrLongAll: number;
      concNetLe8TdrShortAll: number;
      concGrossLe4TdrLongOl: number;
      concGrossLe4TdrShortOl: number;
      concGrossLe8TdrLongOl: number;
      concGrossLe8TdrShortOl: number; 
      concNetLe4TdrLongOl: number;
      concNetLe4TdrShortOl: number;
      concNetLe8TdrLongOl: number;
      concNetLe8TdrShortOl: number;
      concGrossLe4TdrLongOther: number;
      concGrossLe4TdrShortOther: number;  
      concGrossLe8TdrLongOther: number;
      concGrossLe8TdrShortOther: number;
      concNetLe4TdrLongOther: number;
      concNetLe4TdrShortOther: number;
      concNetLe8TdrLongOther: number;
      concNetLe8TdrShortOther: number;
      contractUnits: string;
    }
Behavior3/5

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

Annotations provide readOnlyHint, idempotentHint, openWorldHint. The description adds context about scope (commodities, indices, financial instruments) but does not elaborate on behavioral traits beyond what annotations already indicate. No contradiction.

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?

The description is two sentences, front-loaded with the purpose, and each sentence adds value without fluff. It is concise and well-structured.

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

Completeness3/5

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

While the description explains what the tool accesses, it does not describe the output format, fields, or pagination. No output schema exists, so the description should supplement this. The annotations cover some aspects but not output.

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 coverage is 100% with descriptions for all three parameters. The description does not add any extra meaning beyond the schema, such as date format or constraints. Baseline score 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?

The description clearly states 'Access comprehensive Commitment of Traders (COT) reports' and specifies that it provides detailed positions across various sectors. It distinguishes itself from siblings like getCOTAnalysis and getCOTList by being the comprehensive report.

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 implies usage for market sentiment assessment and tracking positions, but does not explicitly state when to use this tool versus alternatives like getCOTAnalysis or getCOTList. No exclusions or conditions are provided.

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/imbenrabi/Financial-Modeling-Prep-MCP-Server'

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