Skip to main content
Glama
crazyrabbitLTC

Morpho API MCP Server

get_vault_reallocates

Retrieve reallocation details for a specific vault, including timestamps and order direction, through the Morpho API MCP Server's GraphQL interface.

Instructions

Get vault reallocates for a specific vault.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstNo
orderByNo
orderDirectionNo
skipNo
vaultAddressYes

Implementation Reference

  • Handler implementation that builds and executes a GraphQL query to retrieve vault reallocate events for a given vault address, validates the response, and returns formatted JSON data.
    if (name === GET_VAULT_REALLOCATES_TOOL) {
        try {
              const { vaultAddress, first, skip, orderBy = 'Timestamp', orderDirection = 'Asc' } = params as VaultReallocateParams;
              const queryParams = buildQueryParams({
                first,
                skip,
                orderBy,
                orderDirection,
                where: { vaultAddress_in: [vaultAddress] }
              });
    
              const query = `
              query {
                vaultReallocates${queryParams} {
                  pageInfo {
                    count
                    countTotal
                  }
                  items {
                    id
                    timestamp
                    hash
                    blockNumber
                    caller
                    shares
                    assets
                    type
                    vault {
                      id
                      chain {
                        id
                      }
                    }
                    market {
                      uniqueKey
                    }
                  }
                }
              }`;
    
              const response = await axios.post(MORPHO_API_BASE, { query });
              const validatedData = VaultReallocatesResponseSchema.parse(response.data);
    
              return {
                content: [{ type: 'text', text: JSON.stringify(validatedData.data.vaultReallocates, null, 2) }],
              };
        } catch (error: any) {
              return {
                isError: true,
                content: [{ type: 'text', text: `Error retrieving vault reallocates: ${error.message}` }],
              };
        }
    }
  • src/index.ts:779-799 (registration)
    Tool registration in the listTools handler, including name, description, and input schema definition.
    {
      name: GET_VAULT_REALLOCATES_TOOL,
      description: 'Get vault reallocates for a specific vault.',
      inputSchema: {
        type: 'object',
        properties: {
          vaultAddress: { type: 'string' },
          first: { type: 'number' },
          skip: { type: 'number' },
          orderBy: {
            type: 'string',
            enum: ['Timestamp']
          },
          orderDirection: {
            type: 'string',
            enum: ['Asc', 'Desc']
          }
        },
        required: ['vaultAddress']
      },
    },
  • Zod schema for validating the GraphQL response from the vaultReallocates query.
    const VaultReallocatesResponseSchema = z.object({
      data: z.object({
        vaultReallocates: z.object({
          items: z.array(VaultReallocateSchema),
          pageInfo: PageInfoSchema
        })
      })
    });
  • Zod schema defining the structure of individual vault reallocate events.
    const VaultReallocateSchema = z.object({
      id: z.string(),
      timestamp: z.number(),
      hash: z.string(),
      blockNumber: z.number(),
      caller: z.string(),
      shares: z.union([z.string(), z.number()]).transform(stringToNumber),
      assets: z.union([z.string(), z.number()]).transform(stringToNumber),
      type: z.string(),
      vault: z.object({
        id: z.string(),
        chain: z.object({
          id: z.number()
        })
      }),
      market: MarketSchema
    });
  • Constant defining the tool name for consistent reference throughout the code.
    const GET_VAULT_REALLOCATES_TOOL = 'get_vault_reallocates';
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 only states the action ('Get') without details on permissions, rate limits, response format, or whether it's read-only or has side effects. For a tool with 5 parameters and no annotations, this is a significant gap in transparency.

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 that is front-loaded with the core purpose. It avoids unnecessary words, making it concise. However, it could be more structured by including key details, but as-is, it is appropriately sized for its limited content.

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 (5 parameters, no output schema, 0% schema coverage, and no annotations), the description is incomplete. It does not compensate for the lack of structured data, failing to explain parameters, return values, or behavioral traits. This makes it inadequate for effective tool selection and invocation.

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%, meaning no parameters are documented in the schema. The description does not add any meaning beyond the schema, failing to explain parameters like 'vaultAddress' (required), 'first', 'skip', 'orderBy', or 'orderDirection'. This leaves the agent without semantic context for the inputs.

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 vault reallocates for a specific vault,' which includes a verb ('Get') and resource ('vault reallocates'), making it clear what it does. However, it does not differentiate from siblings like 'get_vault_allocation' or 'get_vault_transactions,' leaving ambiguity about what 'reallocates' specifically refers to compared to similar tools.

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 lacks context on prerequisites, such as needing a valid vault address, and does not mention sibling tools like 'get_vault_allocation' or 'get_vault_transactions' that might handle related data, leaving the agent without usage 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