Skip to main content
Glama
iMark21

AEAT MCP Server

by iMark21

get_indicators

Retrieve official Spanish economic indicators including IPREM, minimum wage, and interest rates for tax calculations and legal proceedings from AEAT and BOE sources.

Instructions

Returns key Spanish economic indicators for a given year: IPREM (public income reference), SMI (minimum wage), legal interest rate, and late payment interest rate. These are used as thresholds in tax calculations, subsidies, and legal proceedings. Source: PGE (national budget) + BOE.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesYear (2024-2026)
indicatorNoFilter by specific indicator (optional, returns all if omitted)

Implementation Reference

  • The handler function that retrieves and returns the requested Spanish economic indicators.
    async ({ year, indicator }) => {
      const data = loadData(year);
      if (!data) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                error: "no_data",
                message: `No indicator data for year ${year}. Available: 2025, 2026.`,
              }),
            },
          ],
        };
      }
    
      const result = indicator
        ? { [indicator]: data.indicators[indicator] }
        : data.indicators;
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(
              {
                year,
                indicators: result,
                verified_date: data.verified_date,
                disclaimer:
                  "Informational only. Does not constitute tax advice.",
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • The Zod schema definition for the 'get_indicators' tool inputs (year and optional indicator).
    {
      year: z
        .number()
        .int()
        .min(2024)
        .max(2026)
        .describe("Year (2024-2026)"),
      indicator: z
        .enum(["iprem", "smi", "legal_interest_rate", "late_payment_interest_rate"])
        .optional()
        .describe("Filter by specific indicator (optional, returns all if omitted)"),
    },
  • Registration of the 'get_indicators' tool with the MCP server.
    export function registerIndicatorsTool(server: McpServer) {
      server.tool(
        "get_indicators",
        "Returns key Spanish economic indicators for a given year: " +
          "IPREM (public income reference), SMI (minimum wage), " +
          "legal interest rate, and late payment interest rate. " +
          "These are used as thresholds in tax calculations, subsidies, and legal proceedings. " +
          "Source: PGE (national budget) + BOE.",
        {
          year: z
            .number()
            .int()
            .min(2024)
            .max(2026)
            .describe("Year (2024-2026)"),
          indicator: z
            .enum(["iprem", "smi", "legal_interest_rate", "late_payment_interest_rate"])
            .optional()
            .describe("Filter by specific indicator (optional, returns all if omitted)"),
        },
        async ({ year, indicator }) => {
          const data = loadData(year);
          if (!data) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: JSON.stringify({
                    error: "no_data",
                    message: `No indicator data for year ${year}. Available: 2025, 2026.`,
                  }),
                },
              ],
            };
          }
    
          const result = indicator
            ? { [indicator]: data.indicators[indicator] }
            : data.indicators;
    
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(
                  {
                    year,
                    indicators: result,
                    verified_date: data.verified_date,
                    disclaimer:
                      "Informational only. Does not constitute tax advice.",
                  },
                  null,
                  2
                ),
              },
            ],
          };
        }
      );
    }
  • Helper function loadData to read indicator data from JSON files.
    function loadData(year: number) {
      const path = join(__dirname, "..", "data", "indicators", `${year}.json`);
      try {
        return JSON.parse(readFileSync(path, "utf-8"));
      } catch {
        return null;
      }
    }

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/iMark21/aeat-mcp'

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