Skip to main content
Glama

get_index_calculator

Calculate price linkage adjustments using Israeli Central Bureau of Statistics data. Input index code, value, and date range to determine inflation-adjusted amounts in specified currencies.

Instructions

Calculate price linkage using Israel Statistics API index calculator

Input Schema

NameRequiredDescriptionDefault
currencyNoCurrency type. Options: new_sheqel=current Israeli Shekel (default, most common) | old_sheqel=pre-1980s Israeli Shekel | lira=historical Israeli Lira.
explanationNoAdditional explanation or context for the request
fromDateYesStarting date for the linkage calculation in mm-dd-yyyy format (e.g., '01-01-2020'). This is when your original amount was valued.
indexCodeYesThe numeric index code to use for price linkage calculation. Get this from getIndexData or getSubjectCodes first.
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.
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.
valueYesThe original amount in the currency you want to link/adjust for inflation. For example, 100 for 100 shekels.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "currency": { "description": "Currency type. Options: new_sheqel=current Israeli Shekel (default, most common) | old_sheqel=pre-1980s Israeli Shekel | lira=historical Israeli Lira.", "enum": [ "new_sheqel", "old_sheqel", "lira" ], "type": "string" }, "explanation": { "description": "Additional explanation or context for the request", "type": "string" }, "fromDate": { "description": "Starting date for the linkage calculation in mm-dd-yyyy format (e.g., '01-01-2020'). This is when your original amount was valued.", "type": "string" }, "indexCode": { "description": "The numeric index code to use for price linkage calculation. Get this from getIndexData or getSubjectCodes first.", "type": "number" }, "lang": { "description": "Language for response. Options: he=Hebrew (default) | en=English. Use 'en' for English responses.", "enum": [ "he", "en" ], "type": "string" }, "page": { "description": "Page number for pagination. Start with 1 for first page. Use with pagesize to navigate large result sets.", "minimum": 1, "type": "number" }, "pagesize": { "description": "Number of results per page (maximum 1000). Controls how many items to return. Use with page for pagination.", "maximum": 1000, "minimum": 1, "type": "number" }, "toDate": { "description": "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.", "type": "string" }, "value": { "description": "The original amount in the currency you want to link/adjust for inflation. For example, 100 for 100 shekels.", "type": "number" } }, "required": [ "indexCode", "value", "fromDate", "toDate" ], "type": "object" }

Implementation Reference

  • The main handler function that executes the tool logic for get_index_calculator, performing secureFetch to the index calculator endpoint and formatting the response with a 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)`, } }
  • Zod input schema defining parameters for the get_index_calculator tool, including indexCode, value, dates, and optional globals.
    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 server registration of the 'get_index_calculator' tool, 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), }, ], } }) )

Other Tools

Related 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