Skip to main content
Glama

encode_op_return

Encode arbitrary data into Bitcoin OP_RETURN scripts for blockchain storage. Converts text or hex data into the required script format to embed information on-chain.

Instructions

Encode arbitrary data into OP_RETURN script format.

    Args:
        data: Data to encode (string)
        encoding: Encoding for the data ('utf-8', 'hex'). Default: 'utf-8'

    Returns:
        Dictionary with 'script_hex' containing the OP_RETURN script.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
encodingNoutf-8
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the return format ('Dictionary with 'script_hex' containing the OP_RETURN script'), which is helpful, but lacks details on permissions, rate limits, error handling, or side effects. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 well-structured and concise, with a clear purpose statement followed by parameter and return details in a formatted list. Every sentence adds value, and it's front-loaded with the core functionality. Minor improvements could include briefer formatting, but overall it's efficient.

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?

Given the complexity (2 parameters, no annotations, no output schema), the description is moderately complete. It covers purpose, parameters, and returns adequately, but lacks usage guidelines and behavioral details like error cases or integration with sibling tools. For a tool in this context, it meets minimum viability but has clear gaps.

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 beyond the input schema, which has 0% description coverage. It explains that 'data' is 'Data to encode (string)' and 'encoding' specifies the format with examples ('utf-8', 'hex') and a default. This compensates well for the schema's lack of descriptions, though it could elaborate on data constraints or encoding implications.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Encode arbitrary data into OP_RETURN script format.' It specifies the verb ('encode') and resource ('arbitrary data'), making it clear what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'decode_op_return' or 'build_op_return_transaction' beyond the encoding focus.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'decode_op_return' (for decoding) or 'build_op_return_transaction' (which might incorporate OP_RETURN encoding), nor does it specify prerequisites or contexts for usage. This leaves the agent without clear direction on tool selection.

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/EricGrill/mcp-bitcoin-cli'

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