Skip to main content
Glama
reuvenaor

Israel Statistics MCP

by reuvenaor

get_subject_codes

Retrieve index codes for specific topics from Israel's Central Bureau of Statistics data. Filter results by search text and language, with pagination for large datasets.

Instructions

Get index codes for a specific subject/topic from Israel Statistics API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subjectIdYesThe numeric ID of the topic you want index codes for. Get this ID first by calling getChapterTopics or getIndexTopics.
searchTextNoFilter index codes by description. For example, search 'bread' to find bread-related price indices within the topic.
searchTypeNoSearch matching method. Options: contains=finds text anywhere in name (recommended) | begins_with=name starts with your text | equals=exact name match. Default: contains.
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 main handler function that executes the tool logic: fetches index codes for a subject from the Israel Statistics API using secureFetch, processes parameters, and returns the codes with a summary.
    export async function getSubjectCodes( args: z.infer<typeof getSubjectCodesSchema> ) { const params: Record<string, string> = { id: args.subjectId.toString(), format: "json", download: "false", } if (args.searchText) params.q = args.searchText if (args.searchType) params.string_match_type = args.searchType // Extract global parameters const globalParams: GlobalParams = { lang: args.lang, page: args.page, pagesize: args.pagesize, } const data = await secureFetch( "index/catalog/subject", params, subjectCodesResponseSchema, globalParams ) return { codes: data.code, summary: `Found ${data.code.length} index codes for subject ${args.subjectId}.`, } }
  • Zod input schema defining parameters for get_subject_codes: subjectId (required), optional searchText, searchType, pagination (page, pagesize), lang, and explanation.
    export const getSubjectCodesSchema = z.object({ subjectId: z .number() .describe( "The numeric ID of the topic you want index codes for. Get this ID first by calling getChapterTopics or getIndexTopics." ), searchText: z .string() .optional() .describe( "Filter index codes by description. For example, search 'bread' to find bread-related price indices within the topic." ), searchType: searchTypeSchema.optional(), ...globalParamsSchema, explanation: z .string() .optional() .describe("Additional explanation or context for the request"), })
  • src/index.ts:146-164 (registration)
    MCP tool registration: registers 'get_subject_codes' with description, input schema, and wrapped handler (with rate limiting) that calls getSubjectCodes and formats response.
    server.registerTool( "get_subject_codes", { description: "Get index codes for a specific subject/topic from Israel Statistics API", inputSchema: getSubjectCodesSchema.shape, }, withRateLimit(async (args) => { const result = await getSubjectCodes(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