Skip to main content
Glama

base64_encode_text

Convert text to Base64 encoding for data transmission or storage. This tool encodes plain text into Base64 format, which is commonly used in web development, APIs, and data handling to represent binary data as ASCII text.

Instructions

将文本转换为Base64编码

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Implementation Reference

  • The @mcp.tool() decorated function implementing the base64_encode_text tool. It encodes the input text string to Base64 format using base64.b64encode, handles UTF-8 encoding/decoding, 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)}"

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