Skip to main content
Glama
crazyrabbitLTC

Morpho API MCP Server

get_vault_apy_history

Retrieve historical Annual Percentage Yield (APY) data for a specific vault by providing its address and a time range with interval options.

Instructions

Get historical APY data for a vault.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes
optionsYes

Implementation Reference

  • Handler function that performs a GraphQL query to the Morpho API to fetch historical APY and netApy data for a specific vault.
    if (name === GET_VAULT_APY_HISTORY_TOOL) {
      try {
        const { address, options } = params as VaultApyHistoryParams;
        const query = `
          query {
            vaultByAddress(address: "${address}") {
              address
              historicalState {
                apy(options: {
                  startTimestamp: ${options.startTimestamp}
                  endTimestamp: ${options.endTimestamp}
                  interval: ${options.interval}
                }) {
                  x
                  y
                }
                netApy(options: {
                  startTimestamp: ${options.startTimestamp}
                  endTimestamp: ${options.endTimestamp}
                  interval: ${options.interval}
                }) {
                  x
                  y
                }
              }
            }
          }`;
    
        const response = await axios.post(MORPHO_API_BASE, { query });
        const validatedData = VaultApyHistoryResponseSchema.parse(response.data);
    
        return {
          content: [{ type: 'text', text: JSON.stringify(validatedData.data.vaultByAddress, null, 2) }]
        };
      } catch (error: any) {
        return {
          isError: true,
          content: [{ type: 'text', text: `Error retrieving vault APY history: ${error.message}` }]
        };
      }
    }
  • src/index.ts:866-888 (registration)
    Tool registration in the listTools response, including name, description, and input schema definition.
    {
      name: GET_VAULT_APY_HISTORY_TOOL,
      description: 'Get historical APY data for a vault.',
      inputSchema: {
        type: 'object',
        properties: {
          address: { type: 'string' },
          options: {
            type: 'object',
            properties: {
              startTimestamp: { type: 'number' },
              endTimestamp: { type: 'number' },
              interval: {
                type: 'string',
                enum: ['HOUR', 'DAY', 'WEEK', 'MONTH']
              }
            },
            required: ['startTimestamp', 'endTimestamp', 'interval']
          }
        },
        required: ['address', 'options']
      }
    }
  • Zod schema for parsing and validating the GraphQL response containing vault historical APY data.
    const VaultApyHistoryResponseSchema = z.object({
      data: z.object({
        vaultByAddress: z.object({
          address: z.string(),
          historicalState: z.object({
            apy: z.array(TimeseriesPointSchema),
            netApy: z.array(TimeseriesPointSchema)
          })
        })
      })
    });
  • TypeScript type definition for the input parameters expected by the get_vault_apy_history tool.
    type VaultApyHistoryParams = {
      address: string;
      options: {
        startTimestamp: number;
        endTimestamp: number;
        interval: 'HOUR' | 'DAY' | 'WEEK' | 'MONTH';
      };
    };
  • Constant defining the tool name for consistent reference throughout the code.
    const GET_VAULT_APY_HISTORY_TOOL = 'get_vault_apy_history';
Behavior1/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers none. It doesn't indicate whether this is a read-only operation, what permissions might be required, rate limits, error conditions, or what format/scope the historical data returns. This leaves critical behavioral aspects completely undocumented.

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 that gets straight to the point with zero wasted words. It's appropriately sized for a simple data retrieval tool and front-loads the essential information.

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 (2 parameters with nested objects, no output schema, and 0% schema coverage), the description is inadequate. It doesn't explain what the tool returns, how to interpret results, or provide necessary context about the parameters. For a historical data retrieval tool with time-based filtering, more completeness is needed.

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 but fails to do so. It mentions 'historical APY data' which implies time-based parameters, but doesn't explain the required 'address' and 'options' parameters, their purposes, or the meaning of the interval enum values. The description adds minimal value beyond what's inferred from the tool name.

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 historical APY data') and the resource ('for a vault'), making the purpose immediately understandable. It distinguishes this from general APY tools by specifying 'vault' context, though it doesn't explicitly differentiate from the sibling 'get_historical_apy' tool.

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 the sibling 'get_historical_apy' tool, nor does it specify prerequisites, appropriate contexts, or limitations for retrieving vault-specific APY history.

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