get_account_overview
Retrieve detailed account summaries, including positions and transactions, for a specified address and chain ID using the Morpho API MCP Server.
Instructions
Get account overview including positions and transactions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | ||
| chainId | No |
Implementation Reference
- src/index.ts:1238-1286 (handler)Handler implementation for get_account_overview tool. Parses params, constructs GraphQL query to fetch user market positions, vault positions, and transactions from Morpho API, validates response, and returns JSON.if (name === GET_ACCOUNT_OVERVIEW_TOOL) { try { const { address, chainId = 1 } = params as AccountOverviewParams; const query = ` query { userByAddress( chainId: ${chainId} address: "${address}" ) { address marketPositions { market { uniqueKey } borrowAssets borrowAssetsUsd supplyAssets supplyAssetsUsd } vaultPositions { vault { address name } assets assetsUsd shares } transactions { hash timestamp type } } }`; const response = await axios.post(MORPHO_API_BASE, { query }); const validatedData = AccountOverviewResponseSchema.parse(response.data); return { content: [{ type: 'text', text: JSON.stringify(validatedData.data.userByAddress, null, 2) }], }; } catch (error: any) { return { isError: true, content: [{ type: 'text', text: `Error retrieving account overview: ${error.message}` }], }; } }
- src/index.ts:730-741 (registration)Registration of the get_account_overview tool in the ListTools response, including name, description, and input schema.{ name: GET_ACCOUNT_OVERVIEW_TOOL, description: 'Get account overview including positions and transactions.', inputSchema: { type: 'object', properties: { address: { type: 'string' }, chainId: { type: 'number' } }, required: ['address'] }, },
- src/index.ts:267-273 (schema)Zod schema defining the structure of account overview data, used for response validation.const AccountOverviewSchema = z.object({ address: z.string(), marketPositions: z.array(MarketPositionSchema), vaultPositions: z.array(VaultPositionSchema), transactions: z.array(TransactionSchema), });
- src/index.ts:295-299 (schema)Zod schema for the full API response of account overview, used to parse and validate the GraphQL response.const AccountOverviewResponseSchema = z.object({ data: z.object({ userByAddress: AccountOverviewSchema, }), });
- src/index.ts:313-313 (registration)Constant definition for the tool name, used in registration and handler dispatch.const GET_ACCOUNT_OVERVIEW_TOOL = 'get_account_overview';