Skip to main content
Glama

base64_encode_text

Converts any text input into Base64 encoding. Ideal for encoding text for secure transmission or data storage. Simple and efficient tool for developers and users.

Instructions

将文本转换为Base64编码

Args: text: 要编码的文本 Returns: Base64编码结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Implementation Reference

  • The handler function for the 'base64_encode_text' tool, decorated with @mcp.tool() for registration in FastMCP. It takes a text string, encodes it to base64 using utf-8, and returns the result prefixed with 'Base64编码结果: '. Includes error handling.
    @mcp.tool() def base64_encode_text(text: str) -> str: """将文本转换为Base64编码 Args: text: 要编码的文本 Returns: Base64编码结果 """ try: encoded = base64.b64encode(text.encode("utf-8")).decode("utf-8") return f"Base64编码结果: {encoded}" except Exception as e: return f"编码失败: {str(e)}"

Other Tools

Related 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/liuyazui/base64_server'

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