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
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Safe address | |
| limit | No | Number of transactions to return | |
| offset | No | Offset for pagination |
Implementation Reference
- src/index.ts:169-182 (handler)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"], }, },
- src/index.ts:110-127 (schema)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"], },
- src/index.ts:82-101 (helper)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(); }