Skip to main content
Glama
AbdelStark
by AbdelStark

validate_address

Verify Bitcoin address validity to prevent errors in transactions and ensure proper format before use.

Instructions

Validate a Bitcoin address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesThe Bitcoin address to validate

Implementation Reference

  • The main handler function for the 'validate_address' tool. It parses input arguments using ValidateAddressSchema, calls bitcoinService.validateAddress, and returns a text response indicating validity.
    export async function handleValidateAddress(
      bitcoinService: BitcoinService,
      args: unknown
    ) {
      const result = ValidateAddressSchema.safeParse(args);
      if (!result.success) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Invalid parameters: ${result.error.message}`
        );
      }
    
      const isValid = bitcoinService.validateAddress(result.data.address);
      return {
        content: [
          {
            type: "text",
            text: isValid
              ? `Address ${result.data.address} is valid`
              : `Address ${result.data.address} is invalid`,
          },
        ] as TextContent[],
      };
    }
  • Zod schema defining the input for the validate_address tool: an object with a required 'address' string.
    export const ValidateAddressSchema = z.object({
      address: z.string().min(1, "Address is required"),
    });
  • Tool registration in the MCP server's listTools response, specifying name 'validate_address', description, and input schema.
      name: "validate_address",
      description: "Validate a Bitcoin address",
      inputSchema: {
        type: "object",
        properties: {
          address: {
            type: "string",
            description: "The Bitcoin address to validate",
          },
        },
        required: ["address"],
      } as any,
    } as Tool,
  • Dispatch logic in the callTool request handler that routes 'validate_address' calls to handleValidateAddress.
    case "validate_address": {
      return handleValidateAddress(this.bitcoinService, args);
    }
  • Core helper method in BitcoinService that performs the actual address validation using bitcoinjs-lib's toOutputScript.
    validateAddress(address: string): boolean {
      try {
        bitcoin.address.toOutputScript(address, this.network);
        return true;
      } catch {
        return false;
      }
    }
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. 'Validate' implies a read-only check, but the description doesn't specify what validation entails (format, checksum, network type), whether it requires network connectivity, what happens with invalid inputs, or what the output format will be. This leaves significant behavioral gaps.

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 a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple validation tool and is perfectly front-loaded.

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

Completeness2/5

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

For a validation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what constitutes validation, what the tool returns (success/failure, validation details, error messages), or how it differs from related sibling tools. The agent would lack critical context to use this tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, with the single parameter 'address' clearly documented as 'The Bitcoin address to validate'. The description adds no additional parameter semantics beyond what the schema already provides, so the baseline score of 3 is appropriate.

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 verb ('validate') and resource ('Bitcoin address'), making the purpose immediately understandable. However, it doesn't differentiate this validation tool from potential sibling tools that might also validate addresses in different contexts or with different criteria.

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 whether this is for address format validation, network compatibility checking, or other specific validation contexts, nor does it reference any sibling tools that might serve related purposes.

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

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