Skip to main content
Glama

get_popular_series

Retrieve the 25 most popular BLS series IDs. Optionally filter by a survey abbreviation to limit results to a specific survey.

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

  • Registers the 'get_popular_series' tool on the MCP server with its name, description, optional survey parameter schema (2-letter uppercase regex), and handler that calls client.getPopularSeries(survey).
    export function registerSurveyTools(server: McpServer, client: Client) {
      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 implementation of getPopularSeries: makes a GET request to /timeseries/popular with an optional survey query param and returns the raw API response data.
    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);
      }
    }
  • Input schema for get_popular_series: an optional 'survey' parameter validated as a 2-letter uppercase string (e.g., LA, CU, CE).
    {
      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"),
    },
  • wrapError helper used by the handler to format BlsApiError and unexpected errors into MCP content responses.
    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)}` }],
      };
    }
  • src/index.ts:16-16 (registration)
    Entry point calling registerSurveyTools(server, client), which registers get_popular_series among other survey tools.
    registerSurveyTools(server, client);
Behavior3/5

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

No annotations are provided, so the description carries full burden. It reveals the tool returns 25 series IDs and can be filtered, but gives no details on rate limits, authentication, or data source. Adequate for a simple retrieval.

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?

Single sentence, front-loaded with key action and count, no unnecessary words. Efficient.

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

Completeness5/5

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

Given the tool's simplicity (1 optional param, no output schema), the description fully covers purpose, scope, and filter option. No gaps.

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?

Input schema has 100% coverage with description for survey parameter. The description adds 'filter by survey' which is already in the schema, so no new value beyond baseline.

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 specifies the action (retrieve), resource (popular BLS series IDs), count (25), and scope (overall or filtered by survey). It distinguishes from siblings like get_single_series, as it returns a list of popular series rather than a specific one.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states the optional filter by survey, guiding when to use it. However, it does not explicitly mention when not to use this tool versus siblings like get_latest_series, though the context is implied.

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