Skip to main content
Glama
liuyazui

Base64 MCP Server

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)}"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the transformation function without mentioning any behavioral traits like error handling, encoding standards (e.g., UTF-8), performance characteristics, or whether the operation is idempotent. This leaves significant gaps for a mutation tool.

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

Conciseness5/5

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

The description is perfectly structured with a clear purpose statement followed by parameter and return value sections. Every sentence earns its place with zero wasted words, making it easy to parse and understand quickly.

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?

For a single-parameter transformation tool with no annotations and no output schema, the description covers the basic purpose and parameter meaning adequately. However, it lacks details about the return format (e.g., string format, encoding specifics) and behavioral aspects that would make it complete for safe agent invocation.

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?

The description adds meaningful context for the single parameter ('text: 要编码的文本' - 'text: the text to encode'), which compensates for the 0% schema description coverage. While it doesn't elaborate on constraints like maximum length or character encoding, it clearly explains the parameter's purpose beyond the schema's basic type definition.

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 the specific action ('将文本转换为Base64编码' - 'Convert text to Base64 encoding') and distinguishes it from sibling tools that handle image encoding/decoding. It explicitly identifies the resource (text) and verb (encode), making the purpose unambiguous.

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 clear context by specifying it's for text encoding, which implicitly distinguishes it from the image encoding sibling tool. However, it doesn't explicitly state when to use this versus the decode_text alternative or mention any prerequisites or exclusions.

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

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