Skip to main content
Glama
reuvenaor

Israel Statistics MCP

by reuvenaor

get_main_indices

Retrieve key economic indicators and price indices from Israel's Central Bureau of Statistics, with options for language, formatting, and pagination.

Instructions

Get main indices by different bases from Israel Statistics API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
oldFormatNoSet to true if you need Hebrew text and the legacy display format. Use false (default) for English text and modern formatting.
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 handler function that fetches main indices data from the Israel Statistics API, transforms XML response to JSON, and returns structured data including indices list, update date, and summary.
    export async function getMainIndices( args?: z.infer<typeof getMainIndicesSchema> ): Promise<TransformedMainIndicesResponse> { const params: Record<string, string> = { format: "json", download: "false", } if (args?.oldFormat) params.oldformat = "true" // Extract global parameters const globalParams: GlobalParams = { lang: args?.lang, page: args?.page, pagesize: args?.pagesize, } const data = await secureFetch( "index/data/price_selected", params, mainIndicesXmlResponseSchema, globalParams ) // Transform XML data to a more usable format - handle all elements properly const transformedIndices = data.indices.date.flatMap((dateEntry) => dateEntry.code.map((codeEntry) => ({ code: codeEntry.code[0], // Single value per code entry name: codeEntry.name[0], // Single value per code entry percent: parseFloat(codeEntry.percent[0]), // Single value per code entry year: dateEntry.year[0], // Single value per date entry month: dateEntry.month[0], // Single value per date entry indices: codeEntry.index.map((idx) => ({ value: parseFloat(idx._), // Text content, not in array base: idx.base[0], // Attributes are in arrays with explicitArray:true chainingCoefficient: idx.chainingCoefficient ? parseFloat(idx.chainingCoefficient[0]) : undefined, })), })) ) return { indices: transformedIndices, updateDate: data.indices.UpdateDate[0], summary: `Retrieved ${transformedIndices.length} main indices updated on ${data.indices.UpdateDate[0]}.`, } }
  • Zod input schema for the get_main_indices tool, including optional oldFormat, global pagination/language params, and explanation.
    export const getMainIndicesSchema = z.object({ oldFormat: oldFormatSchema.optional(), ...globalParamsSchema, explanation: z .string() .optional() .describe("Additional explanation or context for the request"), })
  • src/index.ts:186-204 (registration)
    Registration of the 'get_main_indices' tool in the MCP server, specifying description, input schema, and handler execution wrapped with rate limiting.
    server.registerTool( "get_main_indices", { description: "Get main indices by different bases from Israel Statistics API", inputSchema: getMainIndicesSchema.shape, }, withRateLimit(async (args) => { const result = await getMainIndices(args) return { content: [ { type: "text", text: JSON.stringify(result), }, ], } }) )

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