Skip to main content
Glama
crazyrabbitLTC

Morpho API MCP Server

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
NameRequiredDescriptionDefault
addressYes
chainIdNo

Implementation Reference

  • 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']
      },
    },
  • 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),
    });
  • 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';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't cover aspects like rate limits, authentication needs, error handling, or what 'overview' entails beyond positions and transactions. This is a significant gap for a tool with no annotation coverage.

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, efficient sentence with zero waste. It's front-loaded with the core purpose and includes specific details like 'positions and transactions', making it appropriately sized and easy to parse.

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 complexity (2 parameters, 0% schema coverage, no output schema, no annotations), the description is incomplete. It doesn't explain parameter usage, return values, or behavioral traits, leaving gaps that hinder an agent's ability to invoke the tool correctly in context with siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions no parameters, failing to explain the meaning of 'address' and 'chainId' or their roles in fetching the account overview. This leaves key input semantics unclear beyond what the bare schema provides.

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 action ('Get') and resource ('account overview'), specifying it includes 'positions and transactions'. This distinguishes it from siblings like get_asset_price or get_markets, though it doesn't explicitly differentiate from get_market_positions or get_vault_positions, which might overlap in scope.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context, or exclusions, leaving the agent to infer usage based on sibling tool names like get_market_positions or get_vault_positions without explicit direction.

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/crazyrabbitLTC/mcp-morpho-server'

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