Skip to main content
Glama
joadataarg

MIST.cash MCP Server

by joadataarg

obtener_assets_transaccion

Fetch assets from a MIST.cash transaction on Starknet to identify transferred tokens like ETH, USDC, USDT, or DAI, even if already spent. Use for transaction analysis.

Instructions

Fetch assets from a transaction. WARNING: This shows assets even if already spent. Use verificar_existencia_transaccion for accurate verification.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transaction_keyYesTransaction key to query
recipient_addressYesStarknet address of the recipient
provider_rpc_urlNoOptional custom Starknet RPC URL

Implementation Reference

  • The core handler function that validates input using Zod schema, sets up Starknet provider and Chamber contract, fetches transaction assets via Mistcash SDK with retry logic and 30s timeout, returns assets with spending warning.
    export async function obtenerAssetsTransaccion(params: unknown) {
        // Validate parameters
        const validated = ObtenerAssetsTransaccionSchema.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);
    
            // Fetch transaction assets with retry logic and 30s timeout
            const assetsPromise = retryWithBackoff(
                () => fetchTxAssets(contract, validated.transaction_key, validated.recipient_address)
            );
    
            const timeoutPromise = new Promise((_, reject) =>
                setTimeout(() => reject(new Error('Request timeout after 30s')), 30000)
            );
    
            const assets = await Promise.race([assetsPromise, timeoutPromise]) as TransactionAssets;
    
            return {
                success: true,
                assets,
                warning: '⚠️ This function shows assets even if they have already been spent. Use verificar_existencia_transaccion for accurate verification.',
                transaction_key: validated.transaction_key,
                recipient_address: validated.recipient_address
            };
        } catch (error) {
            throw new Error(`Failed to fetch transaction assets: ${(error as Error).message}`);
        }
    }
  • Zod runtime validation schema for tool inputs: requires transaction_key (non-empty string), recipient_address (valid Starknet address), optional provider_rpc_url (valid URL).
    export const ObtenerAssetsTransaccionSchema = z.object({
        transaction_key: z.string().min(1, 'Transaction key is required'),
        recipient_address: StarknetAddressSchema,
        provider_rpc_url: z.string().url().optional()
    });
  • src/index.ts:63-84 (registration)
    MCP tool registration in listTools handler: defines name, description, and static JSON schema for input validation, mirroring the Zod schema.
    {
        name: 'obtener_assets_transaccion',
        description: 'Fetch assets from a transaction. WARNING: This shows assets even if already spent. Use verificar_existencia_transaccion for accurate verification.',
        inputSchema: {
            type: 'object',
            properties: {
                transaction_key: {
                    type: 'string',
                    description: 'Transaction key to query',
                },
                recipient_address: {
                    type: 'string',
                    description: 'Starknet address of the recipient',
                },
                provider_rpc_url: {
                    type: 'string',
                    description: 'Optional custom Starknet RPC URL',
                },
            },
            required: ['transaction_key', 'recipient_address'],
        },
    },
Behavior4/5

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

With no annotations provided, the description carries the full burden and discloses key behavioral traits: it warns that assets may be shown even if already spent, which is crucial for understanding the tool's limitations. However, it doesn't cover other aspects like rate limits or authentication needs, leaving some 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 front-loaded with the main purpose and includes a critical warning in a second sentence, with zero wasted words. Every sentence earns its place by providing essential information efficiently.

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 (a fetch operation with a warning), no annotations, and no output schema, the description is adequate but has clear gaps: it explains the purpose and usage well but lacks details on return values or error handling, making it minimally viable for the context.

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 doesn't add any meaning beyond what the schema provides, such as explaining how 'transaction_key' and 'recipient_address' relate to fetching assets, but it doesn't need to compensate for low coverage.

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 'fetch' and resource 'assets from a transaction', making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'verificar_existencia_transaccion' beyond mentioning it as an alternative for verification, so it's not fully sibling-aware.

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 provides explicit guidance on when to use this tool vs. alternatives: it includes a WARNING about showing assets even if spent and directly names 'verificar_existencia_transaccion' for accurate verification, offering clear context and exclusions.

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