get_chapter_topics
Extract specific chapter topics from Israel Statistics API, filtering by categories like Consumer Price Index, Housing Market, or Agriculture Input, and customize language or pagination for detailed insights.
Instructions
Get topics for a specific chapter from Israel Statistics API
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chapterId | Yes | Index category filter. Options: a=Consumer Price Index (groceries, retail) | aa=Housing Market Index | b=Producer Price Index Industrial | ba=Producer Price Index Exports | bb=Producer Price Index Services | c=Residential Building Input | ca=Commercial Building Input | d=Road Construction Input | e=Agriculture Input | f=Bus Input | fa=Public Minibus Input. Leave empty for all. | |
| 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": {
"chapterId": {
"description": "Index category filter. Options: a=Consumer Price Index (groceries, retail) | aa=Housing Market Index | b=Producer Price Index Industrial | ba=Producer Price Index Exports | bb=Producer Price Index Services | c=Residential Building Input | ca=Commercial Building Input | d=Road Construction Input | e=Agriculture Input | f=Bus Input | fa=Public Minibus Input. Leave empty for all.",
"enum": [
"a",
"aa",
"b",
"ba",
"bb",
"c",
"ca",
"d",
"e",
"f",
"fa"
],
"type": "string"
},
"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"
}
},
"required": [
"chapterId"
],
"type": "object"
}
Implementation Reference
- The core handler function that implements the get_chapter_topics tool logic. It extracts parameters, fetches data from the 'index/catalog/chapter' endpoint using secureFetch, checks for housing warnings, and returns topics with a summary.export async function getChapterTopics( args: z.infer<typeof getChapterTopicsSchema> ) { // Extract global parameters const globalParams: GlobalParams = { lang: args.lang, page: args.page, pagesize: args.pagesize, } const data = await secureFetch( "index/catalog/chapter", { id: args.chapterId, format: "json", download: "false" }, chapterTopicsResponseSchema, globalParams ) // Check for housing-related warnings const housingWarning = checkHousingWarnings(args.chapterId) const baseSummary = `Found ${data.subject.length} topics in chapter ${args.chapterId}.` return { topics: data.subject, summary: addHousingWarningsToSummary(baseSummary, housingWarning), } }
- src/schemas/request.schema.ts:56-63 (schema)Zod schema defining the input parameters for the get_chapter_topics tool, including required chapterId and optional globalParams like lang, page, pagesize, and explanation.export const getChapterTopicsSchema = z.object({ chapterId: chapterSchema, ...globalParamsSchema, explanation: z .string() .optional() .describe("Additional explanation or context for the request"), })
- src/index.ts:126-144 (registration)MCP server registration of the 'get_chapter_topics' tool, specifying description, input schema, and handler invocation wrapped in rate limiting.server.registerTool( "get_chapter_topics", { description: "Get topics for a specific chapter from Israel Statistics API", inputSchema: getChapterTopicsSchema.shape, }, withRateLimit(async (args) => { const result = await getChapterTopics(args) return { content: [ { type: "text", text: JSON.stringify(result), }, ], } }) )