Skip to main content
Glama
crazyrabbitLTC

Morpho API MCP Server

get_oracle_details

Retrieve detailed oracle information for a specific market using marketUniqueKey and chainId as inputs. Part of the Morpho API MCP Server for accessing market data.

Instructions

Get oracle details for a specific market.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainIdNo
marketUniqueKeyYes

Implementation Reference

  • Handler function that executes the get_oracle_details tool by constructing a GraphQL query to fetch oracle details for a given market unique key and chain ID, validates the response, and returns the data.
    if (name === GET_ORACLE_DETAILS_TOOL) {
        try {
              const { marketUniqueKey, chainId = 1 } = params as OracleDetailsParams;
              const query = `
              query {
                marketByUniqueKey(
                  uniqueKey: "${marketUniqueKey}"
                  chainId: ${chainId}
                ) {
                  oracle {
                    address
                    type
                    data {
                      ... on MorphoChainlinkOracleData {
                        baseFeedOne {
                          address
                          description
                          vendor
                          pair
                        }
                        vault
                      }
                      ... on MorphoChainlinkOracleV2Data {
                        baseFeedOne {
                          address
                          description
                          vendor
                          pair
                        }
                      }
                    }
                  }
                }
              }`;
    
              const response = await axios.post(MORPHO_API_BASE, { query });
              const validatedData = OracleDetailsResponseSchema.parse(response.data);
    
              return {
                content: [{ type: 'text', text: JSON.stringify(validatedData.data.marketByUniqueKey, null, 2) }],
              };
        } catch (error: any) {
              return {
                isError: true,
                content: [{ type: 'text', text: `Error retrieving oracle details: ${error.message}` }],
              };
        }
    }
  • src/index.ts:719-729 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the name, description, and input schema for get_oracle_details.
      name: GET_ORACLE_DETAILS_TOOL,
      description: 'Get oracle details for a specific market.',
      inputSchema: {
        type: 'object',
        properties: {
          marketUniqueKey: { type: 'string' },
          chainId: { type: 'number' }
        },
        required: ['marketUniqueKey']
      },
    },
  • Zod response schema used to validate the API response in the get_oracle_details handler.
    const OracleDetailsResponseSchema = z.object({
      data: z.object({
        marketByUniqueKey: z.object({
          oracle: OracleSchema,
        }),
      }),
    });
  • Core Zod schemas defining the Oracle, OracleData, and OracleFeed structures used in validation for get_oracle_details.
    const OracleFeedSchema = z.object({
      address: z.string(),
      description: z.string(),
      vendor: z.string(),
      pair: z.string(),
    });
    
    // Oracle Data Schema
    const OracleDataSchema = z.discriminatedUnion('type', [
      z.object({
        type: z.literal('MorphoChainlinkOracle'),
        baseFeedOne: OracleFeedSchema,
        vault: z.string(),
      }),
      z.object({
        type: z.literal('MorphoChainlinkOracleV2'),
        baseFeedOne: OracleFeedSchema,
      }),
    ]);
    
    // Oracle Schema
    const OracleSchema = z.object({
      address: z.string(),
      type: z.string(),
      data: OracleDataSchema,
    });
  • src/index.ts:312-312 (registration)
    Constant definition for the tool name used throughout the code.
    const GET_ORACLE_DETAILS_TOOL = 'get_oracle_details';
Behavior1/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 what the tool does ('Get oracle details') without describing any behavioral traits such as read-only vs. mutative nature, error handling, rate limits, authentication needs, or what the output looks like. 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 that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly. Every part of the sentence earns its place by conveying the core action and target.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (2 parameters, no annotations, no output schema), the description is incomplete. It lacks details on what 'oracle details' include, parameter semantics, behavioral traits, or output format. For a tool that likely returns structured data about oracles, this minimal description is inadequate and leaves too much undefined for effective use.

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

Parameters1/5

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

The description adds no meaning beyond the input schema, which has 0% description coverage. It doesn't explain what 'chainId' or 'marketUniqueKey' represent, their formats, or examples (e.g., chainId as a numeric identifier, marketUniqueKey as a string key). With 2 parameters and low schema coverage, the description fails to compensate, leaving parameters undocumented.

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 verb 'Get' and the resource 'oracle details for a specific market', making the purpose understandable. It distinguishes from siblings like 'get_markets' (general market list) or 'get_asset_price' (specific price data) by focusing on oracle details. However, it doesn't specify what 'oracle details' include (e.g., price feeds, timestamps, sources), leaving some ambiguity.

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 (e.g., needing a valid market key), exclusions, or how it differs from siblings like 'get_asset_price' (which might provide price data without oracle metadata). Usage is implied only by the name and description, with no explicit context or alternatives named.

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