Skip to main content
Glama
reuvenaor

Israel Statistics MCP

by reuvenaor

get_main_indices_by_period

Retrieve key economic indicators from Israel's Central Bureau of Statistics for specific time periods. Filter data by date range to analyze trends in price indices and economic metrics.

Instructions

Get main indices filtered by period from Israel Statistics API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
startDateYesStarting period in yyyymm format, e.g., '202001' for January 2020. Cannot be earlier than 199701 (January 1997).
endDateYesEnding period in yyyymm format, e.g., '202412' for December 2024. Must be later than startDate.
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 core handler function that executes the tool logic: fetches main indices data by specified period from the Israel Statistics API, parses and transforms XML response into structured JSON with grouping by date.
    export async function getMainIndicesByPeriod(
      args: z.infer<typeof getMainIndicesByPeriodSchema>
    ): Promise<TransformedMainIndicesByPeriodResponse> {
      const params = {
        StartDate: args.startDate,
        EndDate: args.endDate,
        format: "xml",
        download: "false",
      }
    
      // Extract global parameters
      const globalParams: GlobalParams = {
        lang: args.lang,
        page: args.page,
        pagesize: args.pagesize,
      }
    
      const data = await secureFetch(
        "index/data/price_selected_b",
        params,
        mainIndicesByPeriodXmlResponseSchema,
        globalParams
      )
    
      // Transform XML data to a more usable format
      const transformedIndices = data.indices.ind.map((indEntry) => ({
        code: indEntry.code[0], // Get first element from array
        name: indEntry.n?.[0] || "Unknown Index", // Get first element from array (note: 'n', not 'name')
        percent: parseFloat(indEntry.percent[0]), // Get first element from array
        date: indEntry.date[0], // Get first element from array (YYYY-MM format)
        index: parseFloat(indEntry.index[0]), // Index value as number
        base: indEntry.base[0], // Base period description
      }))
    
      // Group by date for better organization
      const groupedByDate = transformedIndices.reduce(
        (acc, curr) => {
          const date = curr.date
          if (!acc[date]) {
            acc[date] = []
          }
          acc[date].push(curr)
          return acc
        },
        {} as Record<string, typeof transformedIndices>
      )
    
      return {
        indices: transformedIndices,
        groupedByDate,
        dateRange: `${args.startDate} to ${args.endDate}`,
        totalIndices: transformedIndices.length,
        summary: `Retrieved ${transformedIndices.length} main indices from ${args.startDate} to ${args.endDate}.`,
      }
    }
  • Zod schema defining input validation for the tool: requires startDate and endDate in yyyymm format, optional global params like lang, page, pagesize.
    export const getMainIndicesByPeriodSchema = z.object({
      startDate: z
        .string()
        .describe(
          "Starting period in yyyymm format, e.g., '202001' for January 2020. Cannot be earlier than 199701 (January 1997)."
        ),
      endDate: z
        .string()
        .describe(
          "Ending period in yyyymm format, e.g., '202412' for December 2024. Must be later than startDate."
        ),
      ...globalParamsSchema,
      explanation: z
        .string()
        .optional()
        .describe("Additional explanation or context for the request"),
    })
  • src/index.ts:206-224 (registration)
    MCP tool registration: binds the tool name 'get_main_indices_by_period' to the handler function with input schema and rate limiting wrapper.
    server.registerTool(
      "get_main_indices_by_period",
      {
        description:
          "Get main indices filtered by period from Israel Statistics API",
        inputSchema: getMainIndicesByPeriodSchema.shape,
      },
      withRateLimit(async (args) => {
        const result = await getMainIndicesByPeriod(args)
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result),
            },
          ],
        }
      })
    )
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions filtering by period but doesn't disclose important behavioral traits: what 'main indices' specifically refers to, whether this is a read-only operation, what the response format looks like, potential rate limits, authentication requirements, or error conditions. The description is minimal and lacks behavioral context.

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 states the core purpose without unnecessary words. It's appropriately sized for what it communicates and is front-loaded with the essential information.

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?

For a tool with 6 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what 'main indices' are, what data format to expect, how results are structured, or provide context about the Israel Statistics API. The agent would need to guess about the response format and the nature of the data being retrieved.

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?

Schema description coverage is 100%, so all parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond what's already in the schema descriptions. It mentions 'filtered by period' which aligns with startDate/endDate parameters, but provides no extra context about parameter usage or relationships.

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 action ('Get') and resource ('main indices'), and specifies filtering by period from a specific API. It distinguishes from sibling 'get_main_indices' by adding the period filtering aspect. However, it doesn't explicitly differentiate from other siblings like 'get_all_indices' or 'get_index_data' which might also involve indices.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With multiple sibling tools related to indices (get_all_indices, get_main_indices, get_index_data, etc.), there's no indication of when period-filtered main indices are appropriate versus other index-related operations.

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