Skip to main content
Glama
feriadosapi

feriadosapi

by feriadosapi

Buscar Feriados

buscar_feriados

Search Brazilian holidays by date, type, state, city, year, month, or banking indicator. Get paginated results with name, date, type, description, and FEBRABAN indicator.

Instructions

Busca feriados brasileiros com filtros flexíveis. Use esta tool para consultas gerais quando precisar filtrar por múltiplos critérios ao mesmo tempo. Pode filtrar por data, tipo (NACIONAL/ESTADUAL/MUNICIPAL/FACULTATIVO), estado (UF), cidade (código IBGE), ano e mês. Para buscas mais específicas, prefira usar as tools especializadas (feriados_nacionais, feriados_por_estado, etc.). Retorna lista paginada de feriados com nome, data (DD/MM/YYYY), tipo, descrição e indicador bancário (FEBRABAN).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNoData no formato YYYY-MM-DD (ex: 2026-12-25)
typeNoTipo do feriado
ufNoSigla do estado em maiúsculas (ex: SP, RJ, MG)
ibgeNoCódigo IBGE do município (ex: 3550308 para São Paulo)
anoNoAno com 4 dígitos (ex: 2026)
monthNoMês de 1 a 12 (requer que 'ano' também seja informado)
bancariosNoSe true, retorna apenas feriados bancários (calendário FEBRABAN)

Implementation Reference

  • The 'buscar_feriados' tool registration and handler function. It registers the tool with an inputSchema (zod) and an async handler that calls the feriadosApi to /feriados, formats results, and returns text content. Lines 25-95 contain the full tool definition including the schema (lines 29-68) and the handler callback (lines 70-94).
    export function registerFeriadosTools(server: McpServer) {
        // 1. buscar_feriados
        server.registerTool(
            "buscar_feriados",
            {
                title: "Buscar Feriados",
                description: `Busca feriados brasileiros com filtros flexíveis.
    Use esta tool para consultas gerais quando precisar filtrar por múltiplos critérios ao mesmo tempo.
    Pode filtrar por data, tipo (NACIONAL/ESTADUAL/MUNICIPAL/FACULTATIVO), estado (UF), cidade (código IBGE), ano e mês.
    Para buscas mais específicas, prefira usar as tools especializadas (feriados_nacionais, feriados_por_estado, etc.).
    Retorna lista paginada de feriados com nome, data (DD/MM/YYYY), tipo, descrição e indicador bancário (FEBRABAN).`,
                inputSchema: z.object({
                    date: z
                        .string()
                        .optional()
                        .describe("Data no formato YYYY-MM-DD (ex: 2026-12-25)"),
                    type: z
                        .enum(["NACIONAL", "ESTADUAL", "MUNICIPAL", "FACULTATIVO"])
                        .optional()
                        .describe("Tipo do feriado"),
                    uf: z
                        .string()
                        .length(2)
                        .optional()
                        .describe("Sigla do estado em maiúsculas (ex: SP, RJ, MG)"),
                    ibge: z
                        .string()
                        .optional()
                        .describe(
                            "Código IBGE do município (ex: 3550308 para São Paulo)"
                        ),
                    ano: z
                        .string()
                        .optional()
                        .describe("Ano com 4 dígitos (ex: 2026)"),
                    month: z
                        .string()
                        .optional()
                        .describe("Mês de 1 a 12 (requer que 'ano' também seja informado)"),
                    bancarios: z
                        .boolean()
                        .optional()
                        .describe("Se true, retorna apenas feriados bancários (calendário FEBRABAN)"),
                }),
            },
            async ({ date, type, uf, ibge, ano, month, bancarios }) => {
                try {
                    const data = await feriadosApi<{
                        feriados: unknown[];
                        meta: unknown;
                    }>({
                        path: "/feriados",
                        params: { date, type, uf, ibge, ano, month, bancarios: bancarios ? "true" : undefined },
                    });
    
                    const text =
                        formatHolidayList(data.feriados) + formatMeta(data.meta);
                    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,
                    };
                }
            }
        );
  • Registration entry point. The registerFeriadosTools function (exported from lib/tools/feriados.ts) is imported and called inside registerAllTools, which wires it into the MCP server.
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { registerFeriadosTools } from "./tools/feriados";
    import { registerEstadosTools } from "./tools/estados";
    import { registerMunicipiosTools } from "./tools/municipios";
    
    export function registerAllTools(server: McpServer) {
        registerFeriadosTools(server);
        registerEstadosTools(server);
        registerMunicipiosTools(server);
    }
  • The input schema for 'buscar_feriados' defined using Zod. It defines optional parameters: date (string YYYY-MM-DD), type (enum: NACIONAL/ESTADUAL/MUNICIPAL/FACULTATIVO), uf (2-letter string), ibge (string), ano (4-digit string), month (1-12 string), and bancarios (boolean).
            {
                title: "Buscar Feriados",
                description: `Busca feriados brasileiros com filtros flexíveis.
    Use esta tool para consultas gerais quando precisar filtrar por múltiplos critérios ao mesmo tempo.
    Pode filtrar por data, tipo (NACIONAL/ESTADUAL/MUNICIPAL/FACULTATIVO), estado (UF), cidade (código IBGE), ano e mês.
    Para buscas mais específicas, prefira usar as tools especializadas (feriados_nacionais, feriados_por_estado, etc.).
    Retorna lista paginada de feriados com nome, data (DD/MM/YYYY), tipo, descrição e indicador bancário (FEBRABAN).`,
                inputSchema: z.object({
                    date: z
                        .string()
                        .optional()
                        .describe("Data no formato YYYY-MM-DD (ex: 2026-12-25)"),
                    type: z
                        .enum(["NACIONAL", "ESTADUAL", "MUNICIPAL", "FACULTATIVO"])
                        .optional()
                        .describe("Tipo do feriado"),
                    uf: z
                        .string()
                        .length(2)
                        .optional()
                        .describe("Sigla do estado em maiúsculas (ex: SP, RJ, MG)"),
                    ibge: z
                        .string()
                        .optional()
                        .describe(
                            "Código IBGE do município (ex: 3550308 para São Paulo)"
                        ),
                    ano: z
                        .string()
                        .optional()
                        .describe("Ano com 4 dígitos (ex: 2026)"),
                    month: z
                        .string()
                        .optional()
                        .describe("Mês de 1 a 12 (requer que 'ano' também seja informado)"),
                    bancarios: z
                        .boolean()
                        .optional()
                        .describe("Se true, retorna apenas feriados bancários (calendário FEBRABAN)"),
                }),
  • The formatHolidayList helper used by the handler to format the array of feriados into a readable text output with emoji, date, name, type, banking indicator, and description.
    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");
    }
  • The formatMeta helper used by the handler to format pagination metadata (total count and page info) into a text footer.
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    function formatMeta(meta: any): string {
        if (!meta) return "";
        return `\n\n📊 Total: ${meta.total} | Página ${meta.page}/${meta.total_pages}`;
    }
Behavior4/5

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

The description implies a read-only search operation ('Busca'), but without annotations, it does not explicitly state non-destructive behavior, authentication needs, or other side effects. However, the nature of search and pagination return is disclosed, which is adequate for a query tool.

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 concise (4 sentences), front-loads the main purpose, and efficiently lists filters and return fields without redundant or irrelevant information.

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?

The description covers the tool's flexibility, return fields (name, date, type, description, Febraban indicator), and pagination. It lacks details on pagination mechanics and error handling, but given the lack of output schema, it provides sufficient context for an agent to use the tool effectively.

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 input schema has 100% description coverage, so the description adds no new meaning beyond listing parameters and their types. It repeats information already in the schema, consistent with the baseline for high coverage.

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 that the tool searches Brazilian holidays with flexible filters. It distinguishes itself from sibling tools by mentioning specialized alternatives, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly advises to use this tool for general queries with multiple criteria and to prefer specialized tools (e.g., feriados_nacionais) for specific searches, providing clear when-to-use and when-not-to-use guidance.

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