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),
            },
          ],
        }
      })
    )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the API source but fails to describe key behaviors such as pagination handling, rate limits, authentication needs, error responses, or what the output format looks like. This leaves significant gaps for an agent to understand how to interact with the tool effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy for an agent to quickly grasp the intent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of 7 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral aspects like pagination, error handling, and response structure, which are crucial for proper tool invocation. The high schema coverage helps with parameters, but overall context for usage remains insufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, providing detailed documentation for all 7 parameters. The description adds minimal value beyond this, as it doesn't elaborate on parameter interactions or provide additional context not already in the schema. This meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('index codes for a specific subject/topic'), specifying the source ('from Israel Statistics API'). It distinguishes this tool from siblings like 'get_all_indices' or 'get_main_indices' by focusing on subject-specific codes, though it doesn't explicitly contrast them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you need index codes for a particular subject, and the input schema hints at prerequisites (e.g., 'Get this ID first by calling getChapterTopics or getIndexTopics'). However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_all_indices' or 'get_index_data', leaving usage context somewhat inferred.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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