Skip to main content
Glama

get_single_series

Get data for a single BLS time series for the past three years. Provide a valid series ID to access employment, CPI, or wage statistics.

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 getSingleSeries method on the Client class that makes the actual HTTP GET request to the BLS API endpoint /timeseries/data/{seriesId} and returns the response data.
    async getSingleSeries(seriesId: string): Promise<unknown> {
      try {
        const response = await this.http.get(
          `/timeseries/data/${seriesId}`
        );
        return response.data;
      } catch (error) {
        this.handleError(error);
      }
    }
  • The input schema (Zod validation) for the 'get_single_series' tool — validates the series_id parameter against the SERIES_ID_PATTERN regex.
    {
      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"),
    },
  • The registration of the 'get_single_series' tool via server.tool() inside the registerSeriesTools function, including its description, schema, and handler callback.
    export function registerSeriesTools(server: McpServer, client: Client) {
      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);
          }
        }
      );
  • src/index.ts:15-16 (registration)
    The call to registerSeriesTools(server, client) which registers the 'get_single_series' tool at server startup.
    registerSeriesTools(server, client);
    registerSurveyTools(server, client);
  • The wrapError helper used in the tool handler to format BlsApiError and unexpected errors into the MCP content response format.
    function wrapError(error: unknown): { content: { type: "text"; text: string }[] } {
      if (error instanceof BlsApiError) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error: ${error.message}${error.isRateLimit ? "\nConsider setting BLS_API_KEY for higher rate limits." : ""}`,
            },
          ],
        };
      }
      return {
        content: [{ type: "text" as const, text: `Unexpected error: ${String(error)}` }],
      };
    }
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the data scope (past three years) but does not detail the output format, any rate limits, or potential side effects. For a read operation, this is adequate but lacks depth.

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 extremely concise: two sentences, 16 words. It front-loads the purpose and immediately states the requirement. Every word earns its place, with no redundancy.

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

Completeness4/5

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

For a simple one-parameter tool with full schema coverage, the description is nearly complete. It covers what the tool does, the time range, and input format. However, since there is no output schema, the description could have mentioned the response structure to enhance completeness.

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?

The input schema covers the parameter with 100% description, including an example. The description reinforces the valid character types (uppercase letters, numbers, underscores, etc.), adding value beyond the schema by clarifying the pattern.

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?

The description clearly states the tool retrieves data for a single BLS time series, specifying a three-year time frame. It distinguishes from siblings like 'get_multiple_series' by explicitly saying 'single' and from 'get_latest_series' by implying a historical range.

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 says to 'provide a valid BLS series ID' but does not offer explicit guidance on when to use this tool versus alternatives (e.g., when to use 'get_multiple_series' instead). The usage context is implied but not stated.

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