Skip to main content
Glama
andreax79

otp-mcp-server

by andreax79

delete_token

Remove a one-time password token by specifying a pattern that matches its name or token number.

Instructions

Delete an OTP token matching the pattern.

Args:
    pattern: Token pattern (part of the name or token number)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYes

Implementation Reference

  • The main handler function for the 'delete_token' MCP tool. It is decorated with @mcp.tool() which handles registration. Deletes OTP tokens from the database that match the given pattern.
    @mcp.tool()
    async def delete_token(pattern: str) -> str:
        """
        Delete an OTP token matching the pattern.
    
        Args:
            pattern: Token pattern (part of the name or token number)
        """
        db = get_token_db()
        tokens = find_tokens(pattern)
        if not pattern:
            raise ToolError("Pattern cannot be empty.")
        if not tokens:
            raise ToolError("No OTP tokens found.")
        for token in tokens:
            db.delete()
        return f"{len(tokens)} tokens deleted."
  • Helper function used by delete_token (and other tools) to find OTP tokens matching a search pattern.
    def find_tokens(pattern: str) -> list[Token]:
        """
        Find tokens matching the given pattern.
        """
        db = get_token_db()
        if not pattern:
            return db.get_tokens()
        tokens_list = []
        pattern = pattern.lower()
        for token in db.get_tokens():
            tmp = str(token).lower().strip()
            if pattern in tmp or pattern == f"{token.rowid}#":
                tokens_list.append(token)
        return tokens_list

Tool Definition Quality

Score is being calculated. Check back soon.

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/andreax79/otp-mcp'

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