Skip to main content
Glama

get_multiple_series

Fetch data for up to 50 BLS time series simultaneously, with optional year range and advanced data including catalog, calculations, annual averages, and aspects.

Instructions

Retrieve data for one or more BLS time series. Registered users can include up to 50 series IDs. Optionally specify start/end years (up to 20-year range), and enable catalog, calculations, annual averages, or aspects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
series_idsYesArray of BLS series IDs
start_yearNoStart year in YYYY format
end_yearNoEnd year in YYYY format
catalogNoInclude catalog data (requires registration key)
calculationsNoInclude calculations such as net and percent changes (requires registration key)
annual_averageNoInclude annual average data (requires registration key)
aspectsNoInclude aspect data (requires registration key)

Implementation Reference

  • Handler function for the get_multiple_series tool. Calls client.getSeriesData with series_ids, start_year, end_year, catalog, calculations, annual_average, and aspects parameters, then returns the JSON-stringified result.
      async ({ series_ids, start_year, end_year, catalog, calculations, annual_average, aspects }) => {
        try {
          const data = await client.getSeriesData({
            seriesid: series_ids,
            startyear: start_year,
            endyear: end_year,
            catalog,
            calculations,
            annualaverage: annual_average,
            aspects,
          });
          return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return wrapError(error);
        }
      }
    );
  • Zod schema for get_multiple_series inputs: series_ids (array of 1-50 strings matching SERIES_ID_PATTERN), optional start_year, end_year (4-digit strings), and optional booleans catalog, calculations, annual_average, aspects.
    {
      series_ids: z
        .array(
          z.string().regex(SERIES_ID_PATTERN, "Each series ID must be uppercase with no special characters except _, -, #")
        )
        .min(1)
        .max(50)
        .describe("Array of BLS series IDs"),
      start_year: z
        .string()
        .regex(/^\d{4}$/, "Must be a 4-digit year")
        .optional()
        .describe("Start year in YYYY format"),
      end_year: z
        .string()
        .regex(/^\d{4}$/, "Must be a 4-digit year")
        .optional()
        .describe("End year in YYYY format"),
      catalog: z
        .boolean()
        .optional()
        .describe("Include catalog data (requires registration key)"),
      calculations: z
        .boolean()
        .optional()
        .describe("Include calculations such as net and percent changes (requires registration key)"),
      annual_average: z
        .boolean()
        .optional()
        .describe("Include annual average data (requires registration key)"),
      aspects: z
        .boolean()
        .optional()
        .describe("Include aspect data (requires registration key)"),
    },
  • Registration of the tool named 'get_multiple_series' via server.tool() within registerSeriesTools(), along with its description.
    server.tool(
      "get_multiple_series",
      "Retrieve data for one or more BLS time series. " +
        "Registered users can include up to 50 series IDs. " +
        "Optionally specify start/end years (up to 20-year range), " +
        "and enable catalog, calculations, annual averages, or aspects.",
      {
        series_ids: z
          .array(
            z.string().regex(SERIES_ID_PATTERN, "Each series ID must be uppercase with no special characters except _, -, #")
          )
          .min(1)
          .max(50)
          .describe("Array of BLS series IDs"),
        start_year: z
          .string()
          .regex(/^\d{4}$/, "Must be a 4-digit year")
          .optional()
          .describe("Start year in YYYY format"),
        end_year: z
          .string()
          .regex(/^\d{4}$/, "Must be a 4-digit year")
          .optional()
          .describe("End year in YYYY format"),
        catalog: z
          .boolean()
          .optional()
          .describe("Include catalog data (requires registration key)"),
        calculations: z
          .boolean()
          .optional()
          .describe("Include calculations such as net and percent changes (requires registration key)"),
        annual_average: z
          .boolean()
          .optional()
          .describe("Include annual average data (requires registration key)"),
        aspects: z
          .boolean()
          .optional()
          .describe("Include aspect data (requires registration key)"),
      },
      async ({ series_ids, start_year, end_year, catalog, calculations, annual_average, aspects }) => {
        try {
          const data = await client.getSeriesData({
            seriesid: series_ids,
            startyear: start_year,
            endyear: end_year,
            catalog,
            calculations,
            annualaverage: annual_average,
            aspects,
          });
          return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return wrapError(error);
        }
      }
    );
  • src/index.ts:15-16 (registration)
    Top-level registration: registerSeriesTools(server, client) is called from index.ts to register all series tools including get_multiple_series.
    registerSeriesTools(server, client);
    registerSurveyTools(server, client);
  • SeriesDataParams interface used by getSeriesData, defining the shape of parameters accepted by the BLS API for fetching multiple series data.
    export interface SeriesDataParams {
      seriesid: string[];
      startyear?: string;
      endyear?: string;
      catalog?: boolean;
      calculations?: boolean;
      annualaverage?: boolean;
      aspects?: boolean;
      registrationkey?: string;
    }
Behavior4/5

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

Discloses key behaviors: 50-series limit for registered users, optional year range with 20-year constraint, and registration key requirements for catalog/calculations. No annotations exist, so this adds value beyond schema.

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?

Three short sentences, front-loaded with purpose, no unnecessary words. Every sentence adds essential information.

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

Completeness3/5

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

Inputs are well described, but no output schema or description of return values. For a retrieval tool, missing what data is returned limits completeness for an agent.

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

Parameters4/5

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

Adds the 20-year range constraint on start/end years not present in schema, and summarizes boolean options. Schema already covers 100% of parameters, so baseline 3, but the added range detail earns a 4.

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

Purpose5/5

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

Clearly states it retrieves data for one or more BLS time series, distinguishing from siblings like get_single_series by specifying 'one or more' and the 50-series limit.

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?

Implies usage for multiple series but does not explicitly guide when to choose this tool over alternatives like get_single_series or get_latest_series. No mention of when not to use.

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/larasrinath/bls_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server