Skip to main content
Glama

extract_codes

Extract OTP codes and verification links from the most recent email in an inbox. Use after creating an inbox and receiving a verification or signup email to retrieve codes automatically.

Instructions

Extract OTP codes and verification links from the most recent email in an inbox. Use this after creating an inbox and receiving a verification/signup email.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inbox_idYesThe inbox ID to extract codes from (uses most recent email)

Implementation Reference

  • Registration of the 'extract_codes' tool on the MCP server using server.tool().
    server.tool(
      "extract_codes",
      "Extract OTP codes and verification links from the most recent email in an inbox. Use this after creating an inbox and receiving a verification/signup email.",
      {
        inbox_id: z
          .string()
          .describe("The inbox ID to extract codes from (uses most recent email)"),
      },
      async ({ inbox_id }) => {
        const result = await blipFetch(`/v1/inboxes/${inbox_id}/extract`);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      }
    );
  • Schema definition for the 'extract_codes' tool - requires one parameter: inbox_id (string).
    {
      inbox_id: z
        .string()
        .describe("The inbox ID to extract codes from (uses most recent email)"),
    },
  • Handler function for 'extract_codes' - calls /v1/inboxes/{inbox_id}/extract via blipFetch and returns the result as JSON text.
    async ({ inbox_id }) => {
      const result = await blipFetch(`/v1/inboxes/${inbox_id}/extract`);
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Helper function 'blipFetch' used by the extract_codes handler to make authenticated HTTP requests to the Blip API.
    async function blipFetch(
      path: string,
      options: RequestInit = {}
    ): Promise<unknown> {
      const url = `${API_URL}${path}`;
      const res = await fetch(url, {
        ...options,
        headers: {
          Authorization: `Bearer ${API_KEY}`,
          "Content-Type": "application/json",
          ...options.headers,
        },
      });
    
      if (!res.ok) {
        const body = await res.text();
        throw new Error(`Blip API error ${res.status} on ${options.method || "GET"} ${path}: ${body}`);
      }
    
      if (res.status === 204) return null;
      return res.json();
    }
Behavior3/5

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

The description reveals that the tool operates on the 'most recent email,' which is a key behavioral trait. However, it does not mention edge cases (e.g., no email, multiple emails, no codes found) or the return format. With no annotations, more detail would be expected for a higher score.

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 consists of two concise sentences that front-load the purpose and then provide usage guidance. There is no redundancy or unnecessary information.

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?

The tool has no output schema, so the description should hint at the return value. It mentions extracting 'OTP codes and verification links' but does not describe the format or behavior when no codes are found. This is a gap in completeness for a straightforward tool, though it is otherwise adequate.

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?

The single parameter 'inbox_id' is fully described in the input schema as 'The inbox ID to extract codes from (uses most recent email).' The description adds usage context but no additional semantic meaning beyond the schema, so a baseline score of 3 is appropriate given 100% schema coverage.

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 states the tool's function: 'Extract OTP codes and verification links from the most recent email in an inbox.' This is a specific verb+resource combination that distinguishes it from sibling tools like read_email or wait_for_email.

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 explicitly says 'Use this after creating an inbox and receiving a verification/signup email,' providing clear context for when to use the tool. It does not list alternatives or exclusions, but the usage scenario is well-defined.

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/blipemail/blip'

If you have feedback or need assistance with the MCP directory API, please join our Discord server