Skip to main content
Glama

build_op_return_transaction

Constructs OP_RETURN output data for embedding information in Bitcoin transactions, preparing the script for inclusion without creating or broadcasting the transaction.

Instructions

Construct OP_RETURN output data for a transaction.

    This prepares the data for inclusion in a transaction but does not
    create or broadcast the transaction itself.

    Args:
        data: Data to embed
        encoding: Data encoding ('utf-8' or 'hex')
        use_envelope: Whether to wrap in BTCD envelope format
        envelope_type: Envelope type if use_envelope is True
            ('raw', 'text', 'json', 'hash', 'token', 'file')

    Returns:
        Dictionary with 'script_hex' for the OP_RETURN output.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
encodingNoutf-8
use_envelopeNo
envelope_typeNoraw
Behavior3/5

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

With no annotations provided, the description carries full burden. It clearly states this is a preparation/construction tool that doesn't broadcast transactions, which is valuable behavioral context. However, it doesn't mention error conditions, rate limits, or what happens with invalid inputs. The description adds meaningful context but lacks comprehensive behavioral disclosure.

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?

Perfectly structured with purpose statement first, followed by important behavioral constraint, then organized parameter documentation, and finally return value. Every sentence earns its place with zero wasted words. The information is front-loaded with the most critical details first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter tool with no annotations and no output schema, the description does well by explaining parameters and return value. However, it could provide more context about error cases or edge conditions. Given the complexity and lack of structured documentation elsewhere, it's mostly complete but has minor 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?

With 0% schema description coverage, the description must compensate, which it does effectively. It explains all 4 parameters with clear semantics: 'data' is 'Data to embed', 'encoding' specifies format options, 'use_envelope' controls wrapping behavior, and 'envelope_type' enumerates specific envelope options. This adds substantial value beyond the bare schema.

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 ('Construct OP_RETURN output data for a transaction') and resource ('OP_RETURN output data'), distinguishing it from siblings like broadcast_transaction (which actually sends transactions) and decode_op_return (which interprets existing data). The first sentence precisely defines the tool's function.

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

Usage Guidelines5/5

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

The description explicitly states when NOT to use this tool ('does not create or broadcast the transaction itself'), providing clear boundaries. It also implies when to use it (when preparing data for inclusion) and suggests alternatives like broadcast_transaction for the next step in the workflow.

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