Skip to main content
Glama
newerton

Status Invest MCP Server

get-acoes-datas-pagamento

Retrieve payment dates for stocks within a date range, optionally filtering by specific stocks.

Instructions

Buscar datas de pagamento de ações

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
initialDateYesData inicial
finalDateYesData final
stocksNoAção

Implementation Reference

  • Handler method that orchestrates fetching stock payment dates, calling the private helper getDatesPayment for each stock (or all if none specified).
    async getStockPaymentDates(paymentDatesInput: GetPaymentDatesInput) {
      const { initialDate, finalDate, stocks } = paymentDatesInput;
    
      if (!stocks || stocks.length === 0) {
        const response = await this.getDatesPayment(initialDate, finalDate);
        return response;
      }
    
      const data = [];
      for (const stock of stocks) {
        const response = await this.getDatesPayment(
          initialDate,
          finalDate,
          stock.toUpperCase(),
        );
        if (response && response.length > 0) {
          data.push(...response);
        }
      }
    
      return data;
    }
  • API service handler that makes the actual HTTP request to the external API to get earnings/payment dates.
    async getStockPaymentDates(
      paymentDatesInput: GetPaymentDatesInput,
    ): Promise<GetEarnings | null> {
      const { initialDate, finalDate, stock } = paymentDatesInput;
      let url = `/acao/getearnings?IndiceCode=Ibovespa&Start=${initialDate}&End=${finalDate}`;
      if (stock) {
        url += `&Filter=${stock}`;
      }
      const data = await this.makeJsonRequest<GetEarnings>(url);
      if (!data) return null;
      return data;
    }
  • Input schema for the API service layer (with optional single stock).
    export interface GetPaymentDatesInput {
      initialDate: string;
      finalDate: string;
      stock?: string;
    }
  • Input and output schemas for the service layer (input has optional stocks array, output has payment details).
    export interface GetPaymentDatesInput {
      initialDate: string;
      finalDate: string;
      stocks?: string[];
    }
    
    export interface GetPaymentDatesOutput {
      code: string;
      companyName: string;
      price: number;
      dateCom: string;
      paymentDate: string;
      type: string;
      dy: string;
      url: string;
    }
  • Registration of the tool named 'get-acoes-datas-pagamento' with Zod schema validation for initialDate, finalDate, and optional stocks array.
    private registerGetStockPaymentDatesToolHandler(): void {
      this.server.tool(
        'get-acoes-datas-pagamento',
        'Buscar datas de pagamento de ações',
        {
          initialDate: z
            .string()
            .refine((date) => dayjs(date, 'YYYY-MM-DD', true).isValid(), {
              message: 'Data inicial inválida. Formato esperado: YYYY-MM-DD',
            })
            .describe('Data inicial'),
          finalDate: z
            .string()
            .refine((date) => dayjs(date, 'YYYY-MM-DD', true).isValid(), {
              message: 'Data final inválida. Formato esperado: YYYY-MM-DD',
            })
            .describe('Data final'),
          stocks: z
            .array(
              z.string().regex(/^[A-Z]{4}(3|4|11)$/, {
                message:
                  'Código de ação inválido. Deve seguir o padrão: 4 letras + 3, 4 ou 11.',
              }),
            )
            .optional()
            .describe('Ação'),
        },
        async (args) => {
          const paymentDatesInput = args as GetPaymentDatesInput;
          const infos =
            await this.service.getStockPaymentDates(paymentDatesInput);
    
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(infos, null, 2),
              },
            ],
          };
        },
      );
    }
Behavior2/5

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

With no annotations provided, the description must disclose behavioral traits, but it only states the basic purpose. It does not indicate whether the tool is read-only, what happens with invalid inputs, or any error conditions. The agent is left guessing about side effects and safety.

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 a single concise sentence that is front-loaded. However, given the complexity of three parameters and no output schema, it is too brief to be fully informative. A slightly expanded description would be warranted without being verbose.

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 tool with three parameters, no output schema, and no annotations, the description is insufficient. It omits what the tool returns, whether the 'stocks' parameter is optional, and how dates are interpreted. The agent cannot reliably invoke this tool based solely on the description.

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?

Input schema has 100% description coverage, so parameters are documented. The tool description adds no extra semantic value beyond the schema's brief field descriptions. Baseline score of 3 is appropriate due to high schema coverage.

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 'Buscar datas de pagamento de ações' clearly states the verb (search) and resource (stock payment dates), and distinguishes this tool from sibling tools like analise-carteira and get-acoes. However, it could be more specific by mentioning the date range filtering implied by the input parameters.

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, nor does it mention prerequisites or exclusions. The agent has no context for appropriate vs. inappropriate usage scenarios.

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/newerton/mcp-status-invest'

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