Skip to main content
Glama

get_index_topics

Retrieve index topics from Israel Statistics API by filtering update frequency, searching by name, and customizing language, pagination, and matching methods for tailored results.

Instructions

Get index topics from Israel Statistics API

Input Schema

NameRequiredDescriptionDefault
explanationNoAdditional explanation or context for the request
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.
periodNoFilter indices by update frequency. Options: M=monthly data only | Q=quarterly data only | MQ=both monthly and quarterly (most comprehensive) | QM=quarterly and monthly. Default shows all.
searchTextNoSearch for specific topics by name. For example, use 'housing' to find housing-related indices, or 'food' for food price indices.
searchTypeNoSearch matching method. Options: contains=finds text anywhere in name (recommended) | begins_with=name starts with your text | equals=exact name match. Default: contains.

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" }, "period": { "description": "Filter indices by update frequency. Options: M=monthly data only | Q=quarterly data only | MQ=both monthly and quarterly (most comprehensive) | QM=quarterly and monthly. Default shows all.", "enum": [ "M", "Q", "MQ", "QM" ], "type": "string" }, "searchText": { "description": "Search for specific topics by name. For example, use 'housing' to find housing-related indices, or 'food' for food price indices.", "type": "string" }, "searchType": { "description": "Search matching method. Options: contains=finds text anywhere in name (recommended) | begins_with=name starts with your text | equals=exact name match. Default: contains.", "enum": [ "begins_with", "contains", "equals" ], "type": "string" } }, "type": "object" }

Implementation Reference

  • The core handler function that implements the get_index_topics tool logic. It constructs API parameters from input args, fetches data using secureFetch from the 'index/catalog/tree' endpoint, processes the response, counts the topics, and returns structured topics with a summary.
    export async function getIndexTopics( args?: z.infer<typeof getIndexTopicsSchema> ): Promise<TransformedIndexTopicsResponse> { const params: Record<string, string> = { format: "json", download: "false", } if (args?.period) params.period = args.period 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/tree", params, indexTopicsResponseSchema, globalParams ) // Add statistical benefit: count topics const topicCount = data.chapters.flatMap((c) => c.subject.flatMap((s) => s.code) ).length return { topics: data.chapters, summary: `Found ${topicCount} index codes.` } }
  • Zod schema defining the input shape for the get_index_topics tool, including optional search parameters and global pagination/language options.
    export const getIndexTopicsSchema = z.object({ period: periodSchema.optional(), searchText: z .string() .optional() .describe( "Search for specific topics by name. For example, use 'housing' to find housing-related indices, or 'food' for food price indices." ), searchType: searchTypeSchema.optional(), ...globalParamsSchema, explanation: z .string() .optional() .describe("Additional explanation or context for the request"), })
  • src/index.ts:69-86 (registration)
    Registers the 'get_index_topics' tool with the MCP server, specifying its description, input schema, and handler invocation wrapped in rate limiting.
    server.registerTool( "get_index_topics", { description: "Get index topics from Israel Statistics API", inputSchema: getIndexTopicsSchema.shape, }, withRateLimit(async (args) => { const result = await getIndexTopics(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