Skip to main content
Glama

get_survey

Retrieve metadata for a specific BLS survey by providing its two-letter abbreviation, such as TU, CU, or LA.

Instructions

Retrieve metadata for a single BLS survey by its abbreviation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
survey_abbreviationYesSurvey abbreviation, e.g. TU, CU, LA

Implementation Reference

  • Registration of the 'get_survey' tool with MCP server, including schema definition and handler.
    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);
        }
      }
    );
  • Zod schema for the input parameter 'survey_abbreviation' — required, 2 uppercase letters.
    {
      survey_abbreviation: z
        .string()
        .regex(/^[A-Z]{2}$/, "Survey abbreviation must be exactly 2 uppercase letters")
        .describe("Survey abbreviation, e.g. TU, CU, LA"),
    },
  • Handler function that calls client.getSurvey() and returns the result as JSON string.
    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);
      }
    }
  • Client method that makes the actual HTTP GET request to /surveys/{surveyAbbreviation} on the BLS API.
    async getSurvey(surveyAbbreviation: string): Promise<unknown> {
      try {
        const response = await this.http.get(
          `/surveys/${surveyAbbreviation}`
        );
        return response.data;
      } catch (error) {
        this.handleError(error);
      }
    }
  • src/index.ts:16-16 (registration)
    Entry-point registration call that wires up all survey tools including 'get_survey'.
    registerSurveyTools(server, client);
Behavior3/5

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

No annotations exist, so description carries full burden. It describes a read operation without destructive effects, but lacks details on caching, rate limits, or data freshness. Adequate but minimal.

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, no extraneous words. Every word contributes to understanding.

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?

No output schema exists; description mentions 'metadata' but is vague about what fields are returned. A slightly more detailed description of typical metadata would improve completeness.

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 100% of parameters with examples. The description adds 'by its abbreviation' which reinforces schema but does not add new meaning beyond what schema already provides.

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?

Description clearly states the action (retrieve metadata), the resource (single BLS survey), and the identifier (abbreviation). It distinguishes from sibling 'get_all_surveys' implicitly.

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

Usage Guidelines3/5

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

Description does not explicitly state when to use this tool versus alternatives like 'get_all_surveys'. Usage is implied but not clarified with exclusions or context.

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