Skip to main content
Glama

get_latest_series

Fetch the most current data point for a given BLS series ID, providing up-to-date labor statistics like employment or CPI.

Instructions

Retrieve the most recent data point for a given BLS series ID.

Input Schema

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

Implementation Reference

  • Registration of the 'get_latest_series' MCP tool on the server. Defines the tool name, description, schema (series_id regex-validated string), and the handler callback that delegates to client.getLatestSeries().
    server.tool(
      "get_latest_series",
      "Retrieve the most recent data point for a given BLS series ID.",
      {
        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.getLatestSeries(series_id);
          return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return wrapError(error);
        }
      }
    );
  • Handler function for the 'get_latest_series' tool. Takes a series_id, calls client.getLatestSeries, returns JSON-stringified data, and catches/ wraps errors using wrapError.
    async ({ series_id }) => {
      try {
        const data = await client.getLatestSeries(series_id);
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      } catch (error) {
        return wrapError(error);
      }
    }
  • Client helper method that makes the HTTP GET request to the BLS API endpoint /timeseries/data/{seriesId} with query param { latest: true } to retrieve the most recent data point.
    async getLatestSeries(seriesId: string): Promise<unknown> {
      try {
        const response = await this.http.get(
          `/timeseries/data/${seriesId}`,
          { params: { latest: true } }
        );
        return response.data;
      } catch (error) {
        this.handleError(error);
      }
    }
  • Input schema for the 'get_latest_series' tool. Validates that series_id matches the pattern /^[A-Z0-9_#-]+$/.
    {
      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"),
    },
Behavior2/5

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

No annotations provided. Description only mentions retrieving the most recent data point without details on limitations, caching, or error behavior.

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

Conciseness4/5

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

Single sentence is concise and front-loaded with the core action, but could benefit from a bit more structure or formatting.

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?

Minimal but adequate for a simple tool with one parameter and no output schema. Lacks explanation of return format or edge cases.

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 covers the single parameter with description. Description adds no new meaning beyond what schema already provides; baseline 3.

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 verb 'retrieve' and resource 'most recent data point for a given BLS series ID', distinguishing it from siblings like get_single_series or get_multiple_series.

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?

No guidance on when to use this tool versus alternatives like get_single_series or get_survey. Missing context on prerequisites or scenarios.

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