Skip to main content
Glama

extract_otp_from_text

Extracts 4–8 digit OTP codes and verification links from raw text such as emails, SMS messages, or HTML for automated login and verification workflows.

Instructions

Extract OTP codes (4-8 digits) and verification links from any text.

Args: text: Raw text to scan — email body, SMS content, HTML, etc.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "text": "<text>"
    },
    "name": "extract_otp_from_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses one useful trait — the 4-8 digit pattern it scans for — but says nothing about whether multiple codes are returned, whether links and codes are separated, whether scanning is pure/read-only, or how ambiguous matches are handled. For a zero-annotation tool this leaves substantial gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sections, front-loaded with the core action and pattern bounds. The Args block duplicates the parameter name already in the schema, but it adds descriptive value rather than pure repetition, so little is wasted.

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?

An output schema exists, so return values need not be explained, and the single parameter is documented. However, with no annotations and no statement about multiple-match handling or empty-result behavior, the definition is only adequate for a scanning tool whose output shape is the main unknown.

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?

Schema coverage is 0% for the single 'text' parameter, but the Args section compensates by explaining it as 'Raw text to scan' and enumerating accepted sources (email body, SMS content, HTML). That is meaningfully more than the bare schema string type, though it doesn't specify size limits or encoding expectations.

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 states a specific verb+resource ('Extract OTP codes (4-8 digits) and verification links') and adds a scope qualifier ('from any text') plus concrete digit bounds. It lacks any reference to sibling tools such as read_free_sms or wait_for_sms, so the agent gets no explicit routing signal, but the operation itself is unambiguous.

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?

'From any text — email body, SMS content, HTML, etc.' implies it should be applied post-retrieval to raw content, which is useful context. There is no explicit when-to-use vs. when-not guidance, no mention of how it relates to the SMS/email reading siblings, and no note on what happens if no OTP is present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.