get_catalog_chapters
Retrieve detailed index chapters from the Israel Statistics API. Supports pagination and language selection to access economic data efficiently.
Instructions
Get list of index chapters from Israel Statistics API
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| explanation | No | Additional explanation or context for the request | |
| 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. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"explanation": {
"description": "Additional explanation or context for the request",
"type": "string"
},
"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"
}
},
"type": "object"
}
Implementation Reference
- The core handler function that implements the get_catalog_chapters tool logic. It extracts parameters, calls secureFetch to retrieve catalog chapters from the API endpoint 'index/catalog/catalog', and returns the 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 input schema for the get_catalog_chapters tool, including optional global parameters (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)MCP server registration of the 'get_catalog_chapters' tool, specifying its description, input schema, and handler execution wrapped with rate limiting.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), }, ], } }) )