Skip to main content
Glama
feriadosapi

feriadosapi

by feriadosapi

Verificar se Data é Feriado

verificar_data

Verify if a date is a holiday in Brazil. Get all national, state, and municipal holidays falling on that date. An empty list means it's not a holiday.

Instructions

Verifica se uma data específica é feriado no Brasil. Use quando o usuário perguntar algo como "amanhã é feriado?", "25 de dezembro é feriado?", ou "segunda-feira vai ser feriado?". Retorna todos os feriados que caem naquela data (pode ter mais de um: nacional + municipal, por exemplo). Se retornar lista vazia, a data NÃO é feriado.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesData no formato YYYY-MM-DD (ex: 2026-12-25)

Implementation Reference

  • The async handler function that executes the 'verificar_data' tool logic. It calls the feriados API with the date, checks if any holidays exist, and returns a formatted response indicating whether the date is a holiday or not.
    async ({ data: dateStr }) => {
        try {
            const data = await feriadosApi<{
                data: string;
                feriados: unknown[];
                total: number;
            }>({
                path: `/feriados/data/${dateStr}`,
            });
    
            if (data.total === 0) {
                return {
                    content: [
                        {
                            type: "text" as const,
                            text: `📅 ${data.data} — NÃO é feriado nacional.`,
                        },
                    ],
                };
            }
    
            const text =
                `📅 ${data.data} — É FERIADO! (${data.total} feriado(s) nesta data)\n\n` +
                formatHolidayList(data.feriados);
            return { content: [{ type: "text" as const, text }] };
        } catch (error) {
            return {
                content: [
                    {
                        type: "text" as const,
                        text: `❌ Erro: ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
                isError: true,
            };
        }
    }
  • The input schema for 'verificar_data' using Zod. Defines a required 'data' parameter as a string in YYYY-MM-DD format.
    inputSchema: z.object({
        data: z
            .string()
            .describe("Data no formato YYYY-MM-DD (ex: 2026-12-25)"),
    }),
  • Registration of the 'verificar_data' tool using server.registerTool(), including the tool name, metadata (title, description), input schema, and handler function.
        server.registerTool(
            "verificar_data",
            {
                title: "Verificar se Data é Feriado",
                description: `Verifica se uma data específica é feriado no Brasil.
    Use quando o usuário perguntar algo como "amanhã é feriado?", "25 de dezembro é feriado?", ou "segunda-feira vai ser feriado?".
    Retorna todos os feriados que caem naquela data (pode ter mais de um: nacional + municipal, por exemplo).
    Se retornar lista vazia, a data NÃO é feriado.`,
                inputSchema: z.object({
                    data: z
                        .string()
                        .describe("Data no formato YYYY-MM-DD (ex: 2026-12-25)"),
                }),
            },
            async ({ data: dateStr }) => {
                try {
                    const data = await feriadosApi<{
                        data: string;
                        feriados: unknown[];
                        total: number;
                    }>({
                        path: `/feriados/data/${dateStr}`,
                    });
    
                    if (data.total === 0) {
                        return {
                            content: [
                                {
                                    type: "text" as const,
                                    text: `📅 ${data.data} — NÃO é feriado nacional.`,
                                },
                            ],
                        };
                    }
    
                    const text =
                        `📅 ${data.data} — É FERIADO! (${data.total} feriado(s) nesta data)\n\n` +
                        formatHolidayList(data.feriados);
                    return { content: [{ type: "text" as const, text }] };
                } catch (error) {
                    return {
                        content: [
                            {
                                type: "text" as const,
                                text: `❌ Erro: ${error instanceof Error ? error.message : String(error)}`,
                            },
                        ],
                        isError: true,
                    };
                }
            }
        );
  • Helper function 'formatHolidayList' used by the handler to format the list of holidays into a readable string (with name, type, date, and bank holiday indicator).
    function formatHolidayList(feriados: any[]): string {
        if (!feriados || feriados.length === 0) {
            return "Nenhum feriado encontrado para os critérios informados.";
        }
    
        return feriados
            .map(
                (f) =>
                    `📅 ${f.data} — ${f.nome} (${f.tipo})${f.bancario ? " 🏦" : ""}${f.descricao ? `\n   ${f.descricao}` : ""}`
            )
            .join("\n\n");
    }
  • Declarative tool metadata entry for 'verificar_data' in the toolDetails array, providing name, icon, title, description, params, and returns information for UI purposes.
    {
        name: "verificar_data",
        icon: "📅",
        title: "Verificar se Data é Feriado",
        description:
            "Verifica se uma data específica é feriado. Ideal para \"amanhã é feriado?\" ou \"25/12 é feriado?\".",
        params: [
            { name: "data", type: "string", required: true, desc: "Data no formato YYYY-MM-DD", example: "2026-12-25" },
        ],
        returns: "Se é feriado ou não, com detalhes de todos os feriados naquela data.",
Behavior4/5

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

No annotations are provided, so the description carries full behavioral disclosure. It explains that multiple holidays may be returned (national + municipal) and that an empty list means the date is not a holiday. It does not cover error handling or authentication, but for a simple read-only check, this is adequate.

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 three sentences with a clear, front-loaded structure: first sentence states purpose, second gives usage examples, third explains return behavior. No redundant words, every sentence adds value.

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

Completeness5/5

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

Given the tool's simplicity (single parameter, no output schema, no nested objects), the description fully covers its purpose, input format, and output interpretation. It explains edge cases like multiple holidays and empty result meaning. No gaps.

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 input schema has 100% coverage with a clear description for the single parameter. The tool description adds Brazilian holiday context and examples of expected input formats, reinforcing the schema and making the parameter's purpose more concrete.

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 tool checks if a specific date is a holiday in Brazil, with examples of natural language queries. It distinguishes itself from sibling tools by focusing on a single date verification, not bulk listing or region-based queries.

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 explicit usage examples like 'amanhã é feriado?' and '25 de dezembro é feriado?', but does not contrast with sibling tools or specify when to avoid using it. The context is clear enough, but missing explicit exclusions.

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/feriadosapi/feriadosapi-mcp'

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