Skip to main content
Glama

get_popular_series

Retrieve the 25 most popular BLS series IDs for labor statistics, with optional filtering by specific survey abbreviations like LA, CU, or CE.

Instructions

Retrieve the 25 most popular BLS series IDs overall or for a specific survey. Optionally provide a survey abbreviation to filter by survey.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
surveyNoOptional 2-letter survey abbreviation, e.g. LA, CU, CE

Implementation Reference

  • The handler function for 'get_popular_series' which calls the underlying client method and formats the response.
    async ({ survey }) => {
      try {
        const data = await client.getPopularSeries(survey);
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      } catch (error) {
        return wrapError(error);
      }
    }
  • Registration of the 'get_popular_series' tool with its schema definition and handler.
    server.tool(
      "get_popular_series",
      "Retrieve the 25 most popular BLS series IDs overall or for a specific survey. " +
        "Optionally provide a survey abbreviation to filter by survey.",
      {
        survey: z
          .string()
          .regex(/^[A-Z]{2}$/, "Survey abbreviation must be exactly 2 uppercase letters")
          .optional()
          .describe("Optional 2-letter survey abbreviation, e.g. LA, CU, CE"),
      },
      async ({ survey }) => {
        try {
          const data = await client.getPopularSeries(survey);
          return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return wrapError(error);
        }
      }
    );
  • The actual API implementation of getPopularSeries in the Client class.
    async getPopularSeries(survey?: string): Promise<unknown> {
      try {
        const response = await this.http.get("/timeseries/popular", {
          params: survey ? { survey } : undefined,
        });
        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