Skip to main content
Glama

get_single_series

Retrieve U.S. labor statistics data for a specific time series from the Bureau of Labor Statistics for the past three years by providing a valid series ID.

Instructions

Retrieve data for a single BLS time series for the past three years. Provide a valid BLS series ID (uppercase letters, numbers, underscores, dashes, hashes only).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
series_idYesBLS series ID, e.g. LAUCN040010000000005

Implementation Reference

  • The handler function for the get_single_series tool, which calls the client's getSingleSeries method.
    async ({ series_id }) => {
      try {
        const data = await client.getSingleSeries(series_id);
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      } catch (error) {
        return wrapError(error);
      }
    }
  • Tool registration for get_single_series using server.tool.
    server.tool(
      "get_single_series",
      "Retrieve data for a single BLS time series for the past three years. " +
        "Provide a valid BLS series ID (uppercase letters, numbers, underscores, dashes, hashes only).",
      {
        series_id: z
          .string()
          .regex(SERIES_ID_PATTERN, "Series ID must be uppercase with no special characters except _, -, #")
          .describe("BLS series ID, e.g. LAUCN040010000000005"),
      },
      async ({ series_id }) => {
        try {
          const data = await client.getSingleSeries(series_id);
          return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return wrapError(error);
        }
      }
    );

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