Skip to main content
Glama
5ajaki

Safe MCP Server

by 5ajaki

getMultisigTransaction

Retrieve detailed information about a specific multisig transaction using its unique transaction hash with the Safe MCP Server.

Instructions

Get details of a specific multisig transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
safeTxHashYesSafe transaction hash

Implementation Reference

  • Handler logic for the getMultisigTransaction tool. Extracts safeTxHash from arguments, fetches transaction details from the Safe API endpoint `/multisig-transactions/${safeTxHash}/`, and returns the JSON-formatted response.
    case "getMultisigTransaction": {
      const { safeTxHash } = args as any;
      const data = await this.fetchSafeApi(
        `/multisig-transactions/${safeTxHash}/`
      );
      return {
        content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
      };
    }
  • src/index.ts:129-142 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the name, description, and input schema for getMultisigTransaction.
    {
      name: "getMultisigTransaction",
      description: "Get details of a specific multisig transaction",
      inputSchema: {
        type: "object",
        properties: {
          safeTxHash: {
            type: "string",
            description: "Safe transaction hash",
          },
        },
        required: ["safeTxHash"],
      },
    },
  • Input schema definition for the getMultisigTransaction tool, specifying the required safeTxHash parameter.
    inputSchema: {
      type: "object",
      properties: {
        safeTxHash: {
          type: "string",
          description: "Safe transaction hash",
        },
      },
      required: ["safeTxHash"],
    },
  • Helper method used by the handler to make authenticated API calls to the Safe API, handling URL construction, query params, error handling, and JSON parsing.
    private async fetchSafeApi(
      endpoint: string,
      params?: Record<string, string>
    ): Promise<any> {
      const url = new URL(`${SAFE_API_URL}${endpoint}`);
      if (params) {
        Object.entries(params).forEach(([key, value]) => {
          url.searchParams.append(key, value);
        });
      }
    
      const response = await fetch(url.toString());
      if (!response.ok) {
        throw new McpError(
          ErrorCode.InternalError,
          `Safe API error: ${response.statusText}`
        );
      }
      return response.json();
    }
Install Server

Other Tools

Related 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/5ajaki/safe-mcp-server'

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