get_catalog_chapters
Retrieve catalog chapters from Israel's Central Bureau of Statistics to access structured economic data and price indices for analysis.
Instructions
Get list of index chapters from Israel Statistics API
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language for response. Options: he=Hebrew (default) | en=English. Use 'en' for English responses. | |
| page | No | Page number for pagination. Start with 1 for first page. Use with pagesize to navigate large result sets. | |
| pagesize | No | Number of results per page (maximum 1000). Controls how many items to return. Use with page for pagination. | |
| explanation | No | Additional explanation or context for the request |
Implementation Reference
- The main handler function that executes the tool logic: extracts parameters, calls secureFetch to get catalog data from 'index/catalog/catalog' endpoint, and returns chapters list with a summary.export async function getCatalogChapters( args?: z.infer<typeof getCatalogChaptersSchema> ) { // Extract global parameters const globalParams: GlobalParams = { lang: args?.lang, page: args?.page, pagesize: args?.pagesize, } const data = await secureFetch( "index/catalog/catalog", { format: "json", download: "false" }, catalogChaptersResponseSchema, globalParams ) return { chapters: data.chapters, summary: `Found ${data.chapters.length} index chapters.`, } }
- src/schemas/request.schema.ts:48-54 (schema)Zod schema defining input parameters for the getCatalogChapters tool, including optional global params (lang, page, pagesize) and explanation.export const getCatalogChaptersSchema = z.object({ ...globalParamsSchema, explanation: z .string() .optional() .describe("Additional explanation or context for the request"), })
- src/index.ts:107-124 (registration)Registers the 'get_catalog_chapters' tool with the MCP server, providing description, input schema, and a rate-limited wrapper around the handler function.server.registerTool( "get_catalog_chapters", { description: "Get list of index chapters from Israel Statistics API", inputSchema: getCatalogChaptersSchema.shape, }, withRateLimit(async (args) => { const result = await getCatalogChapters(args) return { content: [ { type: "text", text: JSON.stringify(result), }, ], } }) )