Skip to main content
Glama
5ajaki

Safe MCP Server

by 5ajaki

getSafeTransactions

Retrieve all transactions for a Safe address with optional pagination. Use this tool to query, manage, and analyze transaction details for multisig wallets on the Safe MCP Server.

Instructions

Get all transactions for a Safe address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesSafe address
limitNoNumber of transactions to return
offsetNoOffset for pagination

Implementation Reference

  • Handler function for the getSafeTransactions tool. Fetches all transactions for a given Safe address from the Safe API, with optional pagination parameters.
    case "getSafeTransactions": {
      const { address, limit = 100, offset = 0 } = args as any;
      const data = await this.fetchSafeApi(
        `/safes/${address}/all-transactions/`,
        {
          limit: limit.toString(),
          offset: offset.toString(),
          ordering: "-timestamp",
        }
      );
      return {
        content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
      };
    }
  • src/index.ts:107-128 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.
    {
      name: "getSafeTransactions",
      description: "Get all transactions for a Safe address",
      inputSchema: {
        type: "object",
        properties: {
          address: {
            type: "string",
            description: "Safe address",
          },
          limit: {
            type: "number",
            description: "Number of transactions to return",
          },
          offset: {
            type: "number",
            description: "Offset for pagination",
          },
        },
        required: ["address"],
      },
    },
  • Input schema definition for the getSafeTransactions tool, specifying parameters like address (required), limit, and offset.
    inputSchema: {
      type: "object",
      properties: {
        address: {
          type: "string",
          description: "Safe address",
        },
        limit: {
          type: "number",
          description: "Number of transactions to return",
        },
        offset: {
          type: "number",
          description: "Offset for pagination",
        },
      },
      required: ["address"],
    },
  • Helper method used by getSafeTransactions to make API requests to the Safe API with proper error handling.
    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();
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'Get all transactions' but doesn't clarify aspects like whether this is a read-only operation, potential rate limits, authentication needs, or what 'all' entails (e.g., historical vs. recent). This leaves significant gaps in understanding the tool's behavior beyond basic functionality.

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, clear sentence with no wasted words, making it easy to parse and front-loaded with the core action. It efficiently communicates the basic purpose without unnecessary elaboration.

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 has no annotations, no output schema, and 3 parameters, the description is incomplete. It doesn't address behavioral traits, return values, or usage context, leaving the agent with insufficient information to fully understand how to invoke and interpret results from this tool.

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 input schema already documents parameters like 'address', 'limit', and 'offset' with their types and descriptions. The description adds no additional meaning beyond implying retrieval for a Safe address, which aligns with the schema but doesn't provide extra context such as format examples or constraints.

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 ('Get') and resource ('all transactions for a Safe address'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'getMultisigTransaction' which might also retrieve transactions, leaving room for confusion about scope or type differences.

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?

No guidance is provided on when to use this tool versus alternatives such as 'getMultisigTransaction' or 'decodeTransactionData'. The description lacks context about prerequisites, exclusions, or specific use cases, leaving the agent to infer usage based on tool names alone.

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

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