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;
      }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about the source ('PGE + BOE') and the tool's read-only nature is implied by 'Returns', but it doesn't disclose potential limitations like data availability, rate limits, error conditions, or response format details.

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 efficiently structured in three sentences: first states the core function, second explains usage context, third cites sources. Every sentence adds value with zero wasted words, and key information is front-loaded.

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?

For a read-only tool with 2 parameters and 100% schema coverage but no output schema, the description is adequate but has gaps. It explains purpose and context well, but without annotations or output schema, it should ideally describe the return format (e.g., structured data with values) to be more complete.

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 description coverage is 100%, so the schema already fully documents both parameters. The description adds marginal value by implying the 'year' parameter filters the data and that 'indicator' is optional, but doesn't provide additional syntax or format details beyond what the schema provides.

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 specific action ('Returns') and resources ('key Spanish economic indicators'), listing the exact indicators (IPREM, SMI, legal interest rate, late payment interest rate). It distinguishes from sibling tools by focusing on economic thresholds rather than tax brackets, deductions, or other fiscal data.

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 clear context for when to use this tool ('used as thresholds in tax calculations, subsidies, and legal proceedings'), but does not explicitly state when not to use it or name specific alternatives among the sibling tools. The context is helpful but lacks 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/iMark21/aeat-mcp'

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