Skip to main content
Glama
reuvenaor

Israel Statistics MCP

by reuvenaor

get_index_calculator

Calculate price linkage and adjust amounts for inflation using Israel Statistics data. Convert values between dates based on index codes for accurate financial analysis.

Instructions

Calculate price linkage using Israel Statistics API index calculator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexCodeYesThe numeric index code to use for price linkage calculation. Get this from getIndexData or getSubjectCodes first.
valueYesThe original amount in the currency you want to link/adjust for inflation. For example, 100 for 100 shekels.
fromDateYesStarting date for the linkage calculation in mm-dd-yyyy format (e.g., '01-01-2020'). This is when your original amount was valued.
toDateYesTarget date for the linkage calculation in mm-dd-yyyy format (e.g., '01-01-2024'). This shows what the amount is worth at this later date.
currencyNoCurrency type. Options: new_sheqel=current Israeli Shekel (default, most common) | old_sheqel=pre-1980s Israeli Shekel | lira=historical Israeli Lira.
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 implementing the core logic for the get_index_calculator tool, which fetches index calculator data from the API using secureFetch and returns formatted request, answer, and summary.
    export async function getIndexCalculator( args: z.infer<typeof getIndexCalculatorSchema> ) { const params: Record<string, string> = { value: args.value.toString(), date: args.fromDate, toDate: args.toDate, format: "json", download: "false", } if (args.currency) params.currency = args.currency // Extract global parameters const globalParams: GlobalParams = { lang: args.lang, page: args.page, pagesize: args.pagesize, } const data = await secureFetch( `index/data/calculator/${args.indexCode}`, params, indexCalculatorResponseSchema, globalParams ) return { request: data.request, answer: data.answer, summary: `Linked ${data.request.sum} from ${data.request.from_date} to ${data.request.to_date}: ${data.answer.to_value} (${data.answer.change_percent}% change)`, } }
  • Input schema using Zod for validating parameters of the get_index_calculator tool, including indexCode, value, dates, currency, and global params.
    export const getIndexCalculatorSchema = z.object({ indexCode: z .number() .describe( "The numeric index code to use for price linkage calculation. Get this from getIndexData or getSubjectCodes first." ), value: z .number() .describe( "The original amount in the currency you want to link/adjust for inflation. For example, 100 for 100 shekels." ), fromDate: z .string() .describe( "Starting date for the linkage calculation in mm-dd-yyyy format (e.g., '01-01-2020'). This is when your original amount was valued." ), toDate: z .string() .describe( "Target date for the linkage calculation in mm-dd-yyyy format (e.g., '01-01-2024'). This shows what the amount is worth at this later date." ), currency: currencySchema.optional(), ...globalParamsSchema, explanation: z .string() .optional() .describe("Additional explanation or context for the request"), })
  • src/index.ts:166-184 (registration)
    MCP tool registration for 'get_index_calculator', specifying description, input schema, and handler invocation wrapped in rate limiting.
    server.registerTool( "get_index_calculator", { description: "Calculate price linkage using Israel Statistics API index calculator", inputSchema: getIndexCalculatorSchema.shape, }, withRateLimit(async (args) => { const result = await getIndexCalculator(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