Skip to main content
Glama

get_latest_series

Retrieve the most recent data point for a U.S. labor statistics series from the Bureau of Labor Statistics API.

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 and handler definition for get_latest_series tool.
    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);
        }
      }
    );
  • Implementation of the getLatestSeries method in the BLS API client.
    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);
      }
    }

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