Skip to main content
Glama
crazyrabbitLTC

Morpho API MCP Server

get_whitelisted_markets

Fetch whitelisted markets from Morpho using this tool to streamline access to approved market data through the Morpho API MCP Server.

Instructions

Retrieves only whitelisted markets from Morpho.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:635-641 (registration)
    Registration of the get_whitelisted_markets tool in the tools list returned by listTools. Defines name, description, and input schema (empty object as no params required).
      name: GET_WHITELISTED_MARKETS_TOOL,
      description: 'Retrieves only whitelisted markets from Morpho.',
      inputSchema: {
        type: 'object',
        properties: {}, // No input parameters for this tool
      },
    },
  • Core handler logic for executing the get_whitelisted_markets tool. Sends a GraphQL query to Morpho API for whitelisted markets, parses response, and returns JSON text content.
    if (name === GET_WHITELISTED_MARKETS_TOOL) {
        try {
              const query = `
              query {
                markets(where:{whitelisted: true}) {
                  items {
                    whitelisted
                    uniqueKey
                    lltv
                    oracleAddress
                    irmAddress
                    loanAsset {
                      address
                      symbol
                      decimals
                    }
                    collateralAsset {
                      address
                      symbol
                      decimals
                    }
                    state {
                      borrowApy
                      borrowAssets
                      borrowAssetsUsd
                      supplyApy
                      supplyAssets
                      supplyAssetsUsd
                      fee
                      utilization
                    }
                  }
                }
              }
            `;
    
              const response = await axios.post(MORPHO_API_BASE, { query });
              const validatedData = MorphoApiResponseSchema.parse(response.data);
    
              return {
                content: [
                  {
                      type: 'text',
                      text: JSON.stringify(validatedData.data.markets.items, null, 2),
                  },
                ],
              };
        } catch (error: any) {
          console.error('Error calling Morpho API:', error.message);
          return {
            isError: true,
            content: [{ type: 'text', text: `Error retrieving whitelisted markets: ${error.message}` }],
          };
        }
    }
  • Constant defining the tool name string to avoid typos in registrations and conditionals.
    const GET_WHITELISTED_MARKETS_TOOL = 'get_whitelisted_markets';
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'retrieves' without detailing behavior like response format, pagination, error conditions, or authentication requirements. It's minimal 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 no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 no annotations and no output schema, the description is too sparse. It doesn't explain what 'whitelisted markets' means in context, the return format, or how this differs operationally from 'get_markets', leaving gaps for an AI agent.

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

Parameters4/5

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

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter semantics, and a baseline of 4 is appropriate for this case.

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 ('retrieves') and resource ('whitelisted markets from Morpho'), making the purpose understandable. It distinguishes from sibling 'get_markets' by specifying 'only whitelisted', but could be more explicit about the distinction.

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 like 'get_markets'. The description implies a filtered subset but doesn't explicitly state when to choose this over the broader market retrieval tool.

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