Skip to main content
Glama
jgottlieb84

agentline-mcp

by jgottlieb84

capture_code

Provision a temporary phone number to receive SMS verification codes. Wait for an incoming 2FA code (4-8 digits) and retrieve the phone number and code. Optionally keep the number by setting release_after=False.

Instructions

All-in-one 2FA capture: provision a fresh phone number, wait for an incoming SMS verification code (4-8 digits by default), then release the number. THE killer flow for signups.

Typical use: call this, take phone_number from the result and paste into the signup form, then code will be the extracted 2FA code once it arrives. If no code arrives in timeout seconds, code is null.

Set release_after=False if you plan to keep using the number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
area_codeNo
timeoutNo
release_afterNo

Implementation Reference

  • The handler function that executes the 'capture_code' tool logic: provisions a phone number, waits for an SMS verification code, optionally releases the number, and returns the result.
    @mcp.tool()
    def capture_code(
        area_code: str | None = None,
        timeout: float = DEFAULT_WAIT_TIMEOUT,
        release_after: bool = True,
    ) -> dict:
        """All-in-one 2FA capture: provision a fresh phone number, wait for an
        incoming SMS verification code (4-8 digits by default), then release the
        number. THE killer flow for signups.
    
        Typical use: call this, take `phone_number` from the result and paste into
        the signup form, then `code` will be the extracted 2FA code once it arrives.
        If no code arrives in `timeout` seconds, `code` is null.
    
        Set `release_after=False` if you plan to keep using the number.
        """
        try:
            client = _client_or_init()
            number = client.provision_number(area_code=area_code)
            try:
                code = client.get_verification_code(
                    number.phone_number,
                    timeout=_clamp_timeout(timeout),
                )
                return {
                    "phone_number": number.phone_number,
                    "code": code,
                    "released": release_after,
                }
            finally:
                if release_after:
                    client.release_number(number.phone_number)
        except AgentlineError as e:
            return {"error": str(e), "status_code": e.status_code}
  • The @mcp.tool() decorator registers 'capture_code' as an MCP tool on the FastMCP instance.
    @mcp.tool()
    def capture_code(
  • Helper that clamps the timeout parameter to [1.0, MAX_WAIT_TIMEOUT=180.0] seconds.
    def _clamp_timeout(timeout: float) -> float:
        return max(1.0, min(float(timeout), MAX_WAIT_TIMEOUT))
  • Helper that returns a cached Agentline client instance, initializing it if needed.
    def _client_or_init() -> Agentline:
        global _client
        if _client is None:
            _client = _build_client()
        return _client
Behavior4/5

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

With no annotations, the description carries full disclosure burden. It explains the sequence (provision, wait, release), the code length (4-8 digits), timeout behavior (null if no code), and the release flag. Missing details: immediate release after capture, rate limits, costs, or what happens to the number on timeout.

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?

The description is concise: three sentences covering purpose, typical use, and a key flag. It's front-loaded and efficient. A minor deduction for informal phrasing ('THE killer flow') which adds color but no substance.

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

Completeness4/5

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

Given no output schema, the description covers return values (phone_number and code) and explains null for timeout. It addresses two of three parameters and the workflow. Missing: error handling, format of phone_number, and any country constraints. Adequate for a multi-step tool.

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 coverage is 0%, so description must add value. It explains timeout (default 60) and release_after (default true, with advice). However, area_code is entirely absent from the description, leaving its purpose unclear. Partial coverage reduces score.

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 it's for capturing 2FA codes via SMS, provisioning a phone number, waiting for a code, and releasing the number. It distinguishes from siblings like capture_email_code and wait_for_sms by emphasizing the all-in-one flow. The verb 'capture' and resource 'code' are specific.

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 provides a typical use case: call, get phone_number, paste into signup, then extract code. It advises when to set release_after=False. However, it doesn't explicitly contrast with alternatives or specify when not to use it (e.g., if a persistent number is needed). Area_code is not addressed.

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/jgottlieb84/agentline-mcp'

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