Skip to main content
Glama

get_transaction_state

Retrieve the state and details of a Solana transaction using its transaction ID to verify status and view information.

Instructions

Retrieve the state and details of a transaction using Solana trx ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trxIDNoThe transaction ID

Implementation Reference

  • The core handler function that fetches and returns the transaction state from the P-Link API using the provided trxID.
    export async function get_transaction_state(args: any) {
        const { trxID } = args;
        const fet = await fetch(BASE + '/api/trxState/' + trxID + '/' + new Date().getTime());
        var dat = await fet.text();
        process.stderr.write(`[caisse][info] dat2 ${dat}\n`);
    
        var result = JSON.parse(dat);
        return result;
    }
  • Zod input schema definition for the tool, specifying an optional trxID string parameter.
    export const getGetTrxStateShape = {
        trxID: z.string().optional().describe("The transaction ID")
    };
  • src/solution.ts:68-73 (registration)
    Tool registration in the static tools array used by ListToolsRequestSchema handler, defining name, description, input schema, and annotations.
    {
        name: "get_transaction_state",
        description: get_transaction_state_title,
        inputSchema: jsonSchema(zodToJsonSchema(z.object(getGetTrxStateShape))).jsonSchema,
        annotations: { title: get_transaction_state_title, readOnlyHint: true }
    },
  • Dispatch logic in the CallToolRequestSchema switch statement that invokes the tool handler.
    case "get_transaction_state":
        result = await get_transaction_state(args);
        break;
  • Title string used in tool description and annotations.
    export const get_transaction_state_title = "Retrieve the state and details of a transaction using Solana trx ID";

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/paracetamol951/P-Link-MCP'

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