Skip to main content
Glama

get_all_surveys

Retrieve the complete list of BLS surveys, each with its abbreviation and name, for use in data queries.

Instructions

Retrieve a list of all BLS surveys with their abbreviations and names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'get_all_surveys'. Registers a tool with no parameters that calls client.getAllSurveys() and returns the JSON response.
    server.tool(
      "get_all_surveys",
      "Retrieve a list of all BLS surveys with their abbreviations and names.",
      {},
      async () => {
        try {
          const data = await client.getAllSurveys();
          return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return wrapError(error);
        }
      }
    );
  • The registerSurveyTools function that registers three survey-related tools (including get_all_surveys) on the McpServer via server.tool().
    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);
          }
        }
      );
    
      server.tool(
        "get_all_surveys",
        "Retrieve a list of all BLS surveys with their abbreviations and names.",
        {},
        async () => {
          try {
            const data = await client.getAllSurveys();
            return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
          } catch (error) {
            return wrapError(error);
          }
        }
      );
    
      server.tool(
        "get_survey",
        "Retrieve metadata for a single BLS survey by its abbreviation.",
        {
          survey_abbreviation: z
            .string()
            .regex(/^[A-Z]{2}$/, "Survey abbreviation must be exactly 2 uppercase letters")
            .describe("Survey abbreviation, e.g. TU, CU, LA"),
        },
        async ({ survey_abbreviation }) => {
          try {
            const data = await client.getSurvey(survey_abbreviation);
            return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
          } catch (error) {
            return wrapError(error);
          }
        }
      );
    }
  • The Client.getAllSurveys() method that makes the actual HTTP GET request to /surveys on the BLS API and returns the response data.
    async getAllSurveys(): Promise<unknown> {
      try {
        const response = await this.http.get("/surveys");
        return response.data;
      } catch (error) {
        this.handleError(error);
      }
    }
  • src/index.ts:5-5 (registration)
    Import of registerSurveyTools from ./tools/surveys.js in the main entry point.
    import { registerSurveyTools } from "./tools/surveys.js";
  • src/index.ts:16-16 (registration)
    Call to registerSurveyTools(server, client) in the main entry point, which registers the tool on the MCP server.
    registerSurveyTools(server, client);
Behavior2/5

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

No annotations are present, and the description merely says 'retrieve', which is already implied by the verb. It adds no behavioral details such as authentication, read-only safety, or rate limits.

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 a single, concise sentence that is front-loaded with the verb. Every word adds value with no redundancy.

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?

For a simple parameterless list retrieval, the description is largely adequate. However, it omits potential details like pagination or data scope, and the lack of an output schema leaves return format partially unspecified.

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?

There are zero parameters so the baseline is 4. The description adds meaning by specifying what is returned, compensating for the lack of parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it retrieves a list of all BLS surveys with abbreviations and names. It does not explicitly differentiate from sibling 'get_survey', but 'all' implies the scope.

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 is provided on when to use this tool versus alternatives like 'get_survey'. The description only states what it does, not when it is appropriate.

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