Skip to main content
Glama
reuvenaor

Israel Statistics MCP

by reuvenaor

get_index_data

Retrieve price index data from Israel's Central Bureau of Statistics for specific codes and date ranges to analyze economic trends and inflation.

Instructions

Get index data from Israel Statistics API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe index code (numeric string) you want price data for. Get this code first from getSubjectCodes or getIndexTopics. Example: '120010' for general CPI.
startPeriodNoStarting period in mm-yyyy format like '01-2020' for January 2020. Leave empty to get data from the beginning of the series.
endPeriodNoEnding period in mm-yyyy format like '12-2024' for December 2024. Leave empty to get data up to the most recent available.
formatNoResponse format. Options: json=JSON format (recommended, default) | xml=XML format. Use json unless you specifically need XML.
lastNoGet only the N most recent data points instead of the full series. Useful for getting just the latest values, e.g., use 12 for the last year of monthly data.
coefNoSet to true to include linkage coefficients for inflation calculations. Only needed if you plan to do manual price adjustments.
langNoLanguage for response. Options: he=Hebrew (default) | en=English. Use 'en' for English responses.
pageNoPage number for pagination. Start with 1 for first page. Use with pagesize to navigate large result sets.
pagesizeNoNumber of results per page (maximum 1000). Controls how many items to return. Use with page for pagination.
explanationNoAdditional explanation or context for the request

Implementation Reference

  • The core handler function that implements the get_index_data tool logic: constructs API parameters, fetches data using secureFetch, processes statistics like average value, adds housing warnings, and returns data with summary.
    export async function getIndexData(args: z.infer<typeof getIndexDataSchema>) {
      const params: Record<string, string> = {
        id: args.code,
        format: args.format || "json",
        download: "false",
      }
    
      if (args.startPeriod) params.startPeriod = args.startPeriod
      if (args.endPeriod) params.endPeriod = args.endPeriod
      if (args.last) params.last = args.last.toString()
      if (args.coef) params.coef = args.coef.toString()
    
      // Extract global parameters
      const globalParams: GlobalParams = {
        lang: args.lang,
        page: args.page,
        pagesize: args.pagesize,
      }
    
      const endpoint = `index/data/price`
      const data = await secureFetch(
        endpoint,
        params,
        indexDataResponseSchema,
        globalParams
      )
    
      // Transform the data structure and extract values for statistics
      const allDataPoints = data.month?.[0]?.date || []
      const values = allDataPoints.map((d) => d.currBase.value)
      const avg =
        values.length > 0 ? values.reduce((a, b) => a + b, 0) / values.length : 0
    
      // Check for housing-related warnings
      const housingWarning = checkHousingWarnings(
        undefined,
        args.code,
        data.month?.[0]?.name
      )
      const baseSummary = `Retrieved ${allDataPoints.length} data points. Average value: ${avg.toFixed(2)}.`
    
      return {
        data,
        summary: addHousingWarningsToSummary(baseSummary, housingWarning),
      }
    }
  • Input schema validation using Zod for the get_index_data tool parameters, including required code and optional filters like periods, format, last N points, coefficients, and global params.
    export const getIndexDataSchema = z.object({
      code: z
        .string()
        .describe(
          "The index code (numeric string) you want price data for. Get this code first from getSubjectCodes or getIndexTopics. Example: '120010' for general CPI."
        ),
      startPeriod: z
        .string()
        .optional()
        .describe(
          "Starting period in mm-yyyy format like '01-2020' for January 2020. Leave empty to get data from the beginning of the series."
        ),
      endPeriod: z
        .string()
        .optional()
        .describe(
          "Ending period in mm-yyyy format like '12-2024' for December 2024. Leave empty to get data up to the most recent available."
        ),
      format: formatSchema.optional(),
      last: z
        .number()
        .optional()
        .describe(
          "Get only the N most recent data points instead of the full series. Useful for getting just the latest values, e.g., use 12 for the last year of monthly data."
        ),
      coef: z
        .boolean()
        .optional()
        .describe(
          "Set to true to include linkage coefficients for inflation calculations. Only needed if you plan to do manual price adjustments."
        ),
      ...globalParamsSchema,
      explanation: z
        .string()
        .optional()
        .describe("Additional explanation or context for the request"),
    })
  • src/index.ts:87-104 (registration)
    MCP tool registration for 'get_index_data', specifying description, input schema, and handler invocation wrapped in rate limiting.
    server.registerTool(
      "get_index_data",
      {
        description: "Get index data from Israel Statistics API",
        inputSchema: getIndexDataSchema.shape,
      },
      withRateLimit(async (args) => {
        const result = await getIndexData(args)
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result),
            },
          ],
        }
      })
    )
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states what the tool does at a high level without mentioning authentication requirements, rate limits, error handling, response structure, or whether this is a read-only operation. For a tool with 10 parameters and no annotations, this is insufficient.

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 a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a tool with comprehensive schema documentation, though it could benefit from additional context about when to use it versus sibling tools.

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?

Given the tool's complexity (10 parameters, no output schema, no annotations), the description is inadequate. It doesn't explain the return format, error conditions, authentication needs, or how this tool differs from similar sibling tools. The high parameter count and lack of output schema mean users need more guidance than what's provided.

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 all 10 parameters with detailed descriptions, examples, and constraints. The description adds no additional parameter information beyond what's in the schema, meeting the baseline expectation when schema coverage is complete.

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 clearly states the action ('Get') and resource ('index data from Israel Statistics API'), providing specific purpose. However, it doesn't differentiate this tool from sibling tools like get_all_indices, get_main_indices, or get_main_indices_by_period, which likely retrieve similar data with different scopes or filters.

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. With multiple sibling tools that likely retrieve index data (e.g., get_all_indices, get_main_indices, get_main_indices_by_period), there's no indication of how this tool differs in scope, filtering, or use cases.

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/reuvenaor/israel-statistics-mcp'

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