Skip to main content
Glama
crazyrabbitLTC

Morpho API MCP Server

get_vault_transactions

Retrieve and filter vault transactions by type, order, and pagination to track deposits, withdrawals, and fees efficiently.

Instructions

Get latest vault transactions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstNo
orderByNo
orderDirectionNo
skipNo
type_inNo

Implementation Reference

  • Handler function that executes the get_vault_transactions tool: parses params, builds GraphQL query for transactions (filtered by type if provided), calls Morpho API, validates response with Zod schema, returns JSON or error.
    if (name === GET_VAULT_TRANSACTIONS_TOOL) {
      try {
        const { type_in, ...rest } = params as VaultTransactionsParams;
        const queryParams = buildQueryParams({
          ...rest,
          where: { type_in }
        });
    
        const query = `
          query {
            transactions${queryParams} {
              items {
                hash
                timestamp
                type
                chain {
                  id
                  network
                }
                user {
                  address
                }
                data {
                  ... on VaultTransactionData {
                    shares
                    assets
                    vault {
                      address
                    }
                  }
                }
              }
            }
          }`;
    
        const response = await axios.post(MORPHO_API_BASE, { query });
        const validatedData = VaultTransactionsResponseSchema.parse(response.data);
    
        return {
          content: [{ type: 'text', text: JSON.stringify(validatedData.data.transactions, null, 2) }]
        };
      } catch (error: any) {
        return {
          isError: true,
          content: [{ type: 'text', text: `Error retrieving vault transactions: ${error.message}` }]
        };
      }
  • Zod schema for parsing and validating the GraphQL response data from the vault transactions query.
    const VaultTransactionsResponseSchema = z.object({
      data: z.object({
        transactions: z.object({
          items: z.array(z.object({
            hash: z.string(),
            timestamp: z.number(),
            type: z.string(),
            chain: z.object({
              id: z.number(),
              network: z.string()
            }),
            user: z.object({
              address: z.string()
            }),
            data: z.object({
              shares: z.union([z.string(), z.number()]).transform(stringToNumber).optional(),
              assets: z.union([z.string(), z.number()]).transform(stringToNumber).optional(),
              vault: z.object({
                address: z.string()
              }).optional()
            }).optional()
          }))
        })
      })
    });
  • src/index.ts:840-865 (registration)
    Tool registration in the listTools handler: defines name, description, and JSON input schema for parameters (pagination, ordering, type filter).
    {
      name: GET_VAULT_TRANSACTIONS_TOOL,
      description: 'Get latest vault transactions.',
      inputSchema: {
        type: 'object',
        properties: {
          first: { type: 'number' },
          skip: { type: 'number' },
          orderBy: {
            type: 'string',
            enum: ['Timestamp']
          },
          orderDirection: {
            type: 'string',
            enum: ['Asc', 'Desc']
          },
          type_in: {
            type: 'array',
            items: {
              type: 'string',
              enum: ['MetaMorphoFee', 'MetaMorphoWithdraw', 'MetaMorphoDeposit']
            }
          }
        }
      }
    },
  • TypeScript type definition for the input parameters of the get_vault_transactions tool.
    type VaultTransactionsParams = PaginationParams & {
      orderBy?: 'Timestamp';
      orderDirection?: OrderDirection;
      type_in?: ('MetaMorphoFee' | 'MetaMorphoWithdraw' | 'MetaMorphoDeposit')[];
    };
  • src/index.ts:490-490 (registration)
    Constant defining the tool name string for consistent reference.
    const GET_VAULT_TRANSACTIONS_TOOL = 'get_vault_transactions';
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 the tool gets transactions but fails to describe critical behaviors like pagination (implied by 'first' and 'skip' parameters), rate limits, authentication needs, or what 'latest' means (e.g., time-based or count-based). This leaves significant gaps for safe and effective use.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It is front-loaded with the core purpose, though it could be more structured by including key usage notes. The brevity is appropriate but risks under-specification given the tool's complexity.

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's complexity (5 parameters, 0% schema coverage, no annotations, no output schema), the description is inadequate. It doesn't explain return values, error handling, or how parameters interact, leaving the agent with insufficient information to invoke the tool correctly without trial and error.

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 'latest' but doesn't explain how parameters like 'first,' 'skip,' 'orderBy,' 'orderDirection,' or 'type_in' affect the retrieval. Without this, the agent cannot understand how to control or filter transactions effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose as 'Get latest vault transactions,' which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like 'get_vault_reallocates' or 'get_vault_allocation,' leaving ambiguity about what specific transaction types or scope it covers compared to alternatives.

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 'get_vault_reallocates' or 'get_vault_allocation.' The description implies it retrieves transactions but offers no context on use cases, prerequisites, or exclusions, leaving the agent to guess 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/crazyrabbitLTC/mcp-morpho-server'

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