Skip to main content
Glama
joadataarg

MIST.cash MCP Server

by joadataarg

verificar_existencia_transaccion

Check if a private transaction with specific assets exists on Starknet using claiming keys and recipient details for privacy-preserving payments.

Instructions

Verify if a transaction exists with specific assets. For fully private transactions where assets are not publicly visible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
claiming_keyYesClaiming key for the transaction
recipientYesStarknet address of the recipient
token_addressYesToken contract address (e.g., ETH, USDC)
amountYesAmount in base units (wei)
provider_rpc_urlNoOptional custom Starknet RPC URL

Implementation Reference

  • Implements the core logic: validates input using Zod schema, sets up Starknet provider and Chamber contract, checks transaction existence via checkTxExists with retry and 30s timeout.
    export async function verificarExistenciaTransaccion(params: unknown) {
        // Validate parameters
        const validated = VerificarExistenciaTransaccionSchema.parse(params);
    
        try {
            // Create provider
            const provider = createProvider(
                validated.provider_rpc_url ? { nodeUrl: validated.provider_rpc_url } : undefined
            );
    
            // Get contract address (supports custom Madara address)
            const network = (process.env.STARKNET_NETWORK || 'mainnet') as 'mainnet' | 'sepolia';
            const contractAddress = getContractAddress(network);
    
            // Get contract instance
            const contract = await getChamberContract(provider, contractAddress, CHAMBER_ABI);
    
            // Check transaction existence with retry logic and timeout
            const checkPromise = retryWithBackoff(
                () => checkTxExists(
                    contract,
                    validated.claiming_key,
                    validated.recipient,
                    validated.token_address,
                    validated.amount
                )
            );
    
            const timeoutPromise = new Promise((_, reject) =>
                setTimeout(() => reject(new Error('Request timeout after 30s')), 30000)
            );
    
            const exists = await Promise.race([checkPromise, timeoutPromise]) as boolean;
    
            return {
                success: true,
                exists,
                transaction_details: {
                    claiming_key: validated.claiming_key,
                    recipient: validated.recipient,
                    token_address: validated.token_address,
                    amount: validated.amount
                },
                note: 'This method is for fully private transactions where assets are not publicly visible'
            };
        } catch (error) {
            throw new Error(`Failed to verify transaction existence: ${(error as Error).message}`);
        }
    }
  • Zod schema defining and validating the tool's input parameters: claiming_key, recipient, token_address, amount, optional provider_rpc_url.
    export const VerificarExistenciaTransaccionSchema = z.object({
        claiming_key: z.string().min(1, 'Claiming key is required'),
        recipient: StarknetAddressSchema,
        token_address: StarknetAddressSchema,
        amount: z.string().regex(/^\d+$/, 'Amount must be a numeric string'),
        provider_rpc_url: z.string().url().optional()
    });
  • src/index.ts:86-114 (registration)
    Registers the tool metadata (name, description, inputSchema) in the MCP server's listTools handler.
        name: 'verificar_existencia_transaccion',
        description: 'Verify if a transaction exists with specific assets. For fully private transactions where assets are not publicly visible.',
        inputSchema: {
            type: 'object',
            properties: {
                claiming_key: {
                    type: 'string',
                    description: 'Claiming key for the transaction',
                },
                recipient: {
                    type: 'string',
                    description: 'Starknet address of the recipient',
                },
                token_address: {
                    type: 'string',
                    description: 'Token contract address (e.g., ETH, USDC)',
                },
                amount: {
                    type: 'string',
                    description: 'Amount in base units (wei)',
                },
                provider_rpc_url: {
                    type: 'string',
                    description: 'Optional custom Starknet RPC URL',
                },
            },
            required: ['claiming_key', 'recipient', 'token_address', 'amount'],
        },
    },
  • src/index.ts:186-194 (registration)
    Registers the tool execution handler in the MCP server's CallToolRequestSchema switch statement, dispatching to verificarExistenciaTransaccion.
    case 'verificar_existencia_transaccion':
        return {
            content: [
                {
                    type: 'text',
                    text: JSON.stringify(await verificarExistenciaTransaccion(args), null, 2),
                },
            ],
        };
  • src/index.ts:20-20 (registration)
    Imports the handler function for use in tool registration and dispatch.
    import { verificarExistenciaTransaccion } from './tools/verificar-existencia.js';
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 verifying existence for private transactions, but doesn't explain what 'verify' entails (e.g., returns a boolean, error handling, network calls), authentication needs, rate limits, or side effects. For a tool with no annotations and potential complexity (private transactions), this is a significant gap, though it at least hints at the context.

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 concise with two sentences that directly state the purpose and context. It's front-loaded with the main action and avoids unnecessary details. However, it could be slightly more structured by explicitly separating usage guidance, but overall it's efficient with zero waste.

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 tool's complexity (verifying private transactions), no annotations, no output schema, and 100% schema coverage, the description is incomplete. It lacks details on what the tool returns, error conditions, or behavioral traits, leaving gaps for an AI agent to understand how to use it effectively. The schema covers inputs, but the overall context is insufficient.

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?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds no specific meaning beyond the schema (e.g., it doesn't explain relationships between parameters like 'claiming_key' and 'recipient'). Baseline is 3 when schema does the heavy lifting, as the description doesn't compensate with additional insights.

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: 'Verify if a transaction exists with specific assets.' It specifies the verb (verify) and resource (transaction with assets), and distinguishes it from siblings by mentioning 'fully private transactions where assets are not publicly visible,' which suggests a unique use case. However, it doesn't explicitly differentiate from all siblings (e.g., 'obtener_assets_transaccion' might be related), so it's not a perfect 5.

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

Usage Guidelines3/5

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

The description implies usage for 'fully private transactions where assets are not publicly visible,' providing some context. However, it doesn't explicitly state when to use this tool versus alternatives (e.g., 'obtener_assets_transaccion' or other siblings), nor does it mention prerequisites or exclusions. The guidance is present but limited to an implied scenario.

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