Skip to main content
Glama
joadataarg

MIST.cash MCP Server

by joadataarg

calcular_hash_transaccion

Calculate a unique transaction hash for MIST.cash privacy-preserving payments on Starknet using transaction parameters like recipient address, token contract, and amount.

Instructions

Calculate the unique hash of a transaction using transaction parameters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transaction_keyYesTransaction key
recipient_addressYesStarknet address of the recipient
token_addressYesToken contract address
amountYesAmount in base units (wei)

Implementation Reference

  • The main handler function that implements the tool logic: validates input using schema, checks Starknet addresses, computes transaction hash using txHash from @mistcash/crypto, and returns structured result.
    export async function calcularHashTransaccion(params) {
        // Validate parameters
        const validated = CalcularHashTransaccionSchema.parse(params);
        // Additional validation for addresses
        if (!isValidStarknetAddress(validated.recipient_address)) {
            throw new Error(`Invalid recipient address format: ${validated.recipient_address}`);
        }
        if (!isValidStarknetAddress(validated.token_address)) {
            throw new Error(`Invalid token address format: ${validated.token_address}`);
        }
        try {
            // Compute transaction hash using MIST.cash crypto
            const hash = txHash(validated.transaction_key, validated.recipient_address, validated.token_address, validated.amount);
            return {
                success: true,
                hash,
                transaction_details: {
                    transaction_key: validated.transaction_key,
                    recipient_address: validated.recipient_address,
                    token_address: validated.token_address,
                    amount: validated.amount
                }
            };
        }
        catch (error) {
            throw new Error(`Failed to calculate transaction hash: ${error.message}`);
        }
    }
  • Zod schema defining input validation for the calcular_hash_transaccion tool parameters.
    export const CalcularHashTransaccionSchema = z.object({
        transaction_key: z.string().min(1, 'Transaction key is required'),
        recipient_address: StarknetAddressSchema,
        token_address: StarknetAddressSchema,
        amount: z.string().regex(/^\d+$/, 'Amount must be a numeric string')
    });
  • src/index.js:102-126 (registration)
    Tool registration in the ListToolsRequest handler: defines name, description, and inputSchema for the MCP tool.
        name: 'calcular_hash_transaccion',
        description: 'Calculate the unique hash of a transaction using transaction parameters.',
        inputSchema: {
            type: 'object',
            properties: {
                transaction_key: {
                    type: 'string',
                    description: 'Transaction key',
                },
                recipient_address: {
                    type: 'string',
                    description: 'Starknet address of the recipient',
                },
                token_address: {
                    type: 'string',
                    description: 'Token contract address',
                },
                amount: {
                    type: 'string',
                    description: 'Amount in base units (wei)',
                },
            },
            required: ['transaction_key', 'recipient_address', 'token_address', 'amount'],
        },
    },
  • src/index.js:177-185 (registration)
    Dispatch logic in the CallToolRequest handler: routes requests for 'calcular_hash_transaccion' to the handler function.
    case 'calcular_hash_transaccion':
        return {
            content: [
                {
                    type: 'text',
                    text: JSON.stringify(await calcularHashTransaccion(args), null, 2),
                },
            ],
        };
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 only states the basic function without details on traits like computational cost, error conditions, or output format. For a tool with no annotations, this is inadequate as it misses critical behavioral context.

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 without any fluff. It is appropriately sized and front-loaded, making it easy to understand quickly.

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?

Given the complexity (4 required parameters) and lack of annotations and output schema, the description is incomplete. It does not explain the hash algorithm, output format, or potential errors, leaving significant gaps for the agent to understand the tool fully.

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 description coverage is 100%, meaning all parameters are documented in the input schema. The description adds no additional meaning beyond the schema, such as explaining how parameters interact or their role in hash calculation. Baseline is 3 when schema does the heavy lifting.

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 action ('Calculate') and the target ('unique hash of a transaction'), which is specific and understandable. However, it does not explicitly differentiate from sibling tools like 'verificar_existencia_transaccion' or 'generar_secreto_transaccion', which might involve related transaction operations, so it lacks sibling differentiation for a perfect score.

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 does not mention any context, prerequisites, or exclusions, such as when to choose this over sibling tools like 'verificar_existencia_transaccion' for hash verification. This leaves the agent without usage direction.

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/joadataarg/Mcp-mistcash'

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