Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_domain_records

Fetch ENS text records for a domain to retrieve associated data like avatar, email, URL, and social profiles using Grove's blockchain data access.

Instructions

Get ENS text records for a domain (e.g., avatar, email, url, twitter, github)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesENS domain name
keysYesText record keys to fetch (e.g., ["avatar", "email", "url", "com.twitter", "com.github"])

Implementation Reference

  • Tool registration object defining the 'get_domain_records' tool, including its name, description, and input schema for domain and keys.
    {
      name: 'get_domain_records',
      description: 'Get ENS text records for a domain (e.g., avatar, email, url, twitter, github)',
      inputSchema: {
        type: 'object',
        properties: {
          domain: {
            type: 'string',
            description: 'ENS domain name',
          },
          keys: {
            type: 'array',
            items: { type: 'string' },
            description: 'Text record keys to fetch (e.g., ["avatar", "email", "url", "com.twitter", "com.github"])',
          },
        },
        required: ['domain', 'keys'],
      },
    },
  • Handler case in handleDomainTool function that parses input arguments and delegates execution to DomainResolverService.getDomainRecords, formats the result as MCP response.
    case 'get_domain_records': {
      const domain = args?.domain as string;
      const keys = args?.keys as string[];
    
      const result = await domainResolver.getDomainRecords(domain, keys);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Core helper function implementing ENS text record retrieval: computes namehash, fetches resolver from ENS registry, performs parallel eth_call to resolver.text() for each key, decodes values.
    async getDomainRecords(domain: string, keys: string[]): Promise<EndpointResponse> {
      if (!domain.endsWith('.eth')) {
        return {
          success: false,
          error: 'Domain records currently only supported for ENS (.eth) domains',
        };
      }
    
      try {
        const namehash = this.namehash(domain);
    
        // Get resolver address first
        const resolverData = this.encodeResolverCall(namehash);
        const resolverResult = await this.blockchainService.callRPCMethod(
          'ethereum-mainnet',
          'eth_call',
          [
            {
              to: DomainResolverService.ENS_REGISTRY,
              data: resolverData,
            },
            'latest',
          ]
        );
    
        if (!resolverResult.success || !resolverResult.data) {
          return {
            success: false,
            error: `Failed to get resolver for ${domain}`,
          };
        }
    
        const resolverAddress = '0x' + resolverResult.data.slice(-40);
    
        if (resolverAddress === '0x0000000000000000000000000000000000000000') {
          return {
            success: false,
            error: `No resolver set for ${domain}`,
          };
        }
    
        // Fetch all text records in parallel
        const records = await Promise.all(
          keys.map(async (key) => {
            const textData = this.encodeTextCall(namehash, key);
            const result = await this.blockchainService.callRPCMethod(
              'ethereum-mainnet',
              'eth_call',
              [
                {
                  to: resolverAddress,
                  data: textData,
                },
                'latest',
              ]
            );
    
            return {
              key,
              value: result.success ? this.decodeString(result.data) : null,
            };
          })
        );
    
        return {
          success: true,
          data: {
            domain,
            records,
          },
          metadata: {
            timestamp: new Date().toISOString(),
            endpoint: 'ethereum-mainnet',
          },
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Failed to fetch domain records',
        };
      }
    }
  • src/index.ts:88-101 (registration)
    Main server initialization collects all tools including domain tools via registerDomainHandlers and uses the list for ListToolsRequestHandler.
    const tools: Tool[] = [
      ...registerBlockchainHandlers(server, blockchainService),
      ...registerDomainHandlers(server, domainResolver),
      ...registerTransactionHandlers(server, advancedBlockchain),
      ...registerTokenHandlers(server, advancedBlockchain),
      ...registerMultichainHandlers(server, advancedBlockchain),
      ...registerContractHandlers(server, advancedBlockchain),
      ...registerUtilityHandlers(server, advancedBlockchain),
      ...registerEndpointHandlers(server, endpointManager),
      ...registerSolanaHandlers(server, solanaService),
      ...registerCosmosHandlers(server, cosmosService),
      ...registerSuiHandlers(server, suiService),
      ...registerDocsHandlers(server, docsManager),
    ];
  • Top-level CallToolRequestHandler dispatches tool execution to specific handlers including handleDomainTool for domain tools.
    let result =
      (await handleBlockchainTool(name, args, blockchainService)) ||
      (await handleDomainTool(name, args, domainResolver)) ||
      (await handleTransactionTool(name, args, advancedBlockchain)) ||
      (await handleTokenTool(name, args, advancedBlockchain)) ||
      (await handleMultichainTool(name, args, advancedBlockchain)) ||
      (await handleContractTool(name, args, advancedBlockchain)) ||
      (await handleUtilityTool(name, args, advancedBlockchain)) ||
      (await handleEndpointTool(name, args, endpointManager)) ||
      (await handleSolanaTool(name, args, solanaService)) ||
      (await handleCosmosTool(name, args, cosmosService)) ||
      (await handleSuiTool(name, args, suiService)) ||
      (await handleDocsTool(name, args, docsManager));
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 what the tool does without behavioral details. It does not disclose error handling, rate limits, authentication needs, or what happens if records are missing. This is a significant gap for a tool with potential external dependencies.

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 is front-loaded with the core purpose and includes helpful examples, making it easy to parse quickly.

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

Completeness3/5

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

Given the tool's moderate complexity (fetching external data), lack of annotations, and no output schema, the description is incomplete. It covers the basic operation but omits details on return format, error scenarios, and behavioral traits needed for reliable use.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds minimal value by listing example keys, but does not provide additional semantics beyond what the schema specifies, such as format constraints or edge cases.

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 resource ('ENS text records for a domain'), with examples of specific record types. However, it does not explicitly differentiate from sibling tools like 'resolve_domain' or 'reverse_resolve_domain', which might handle similar ENS-related queries, so it misses the highest score.

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, such as 'resolve_domain' or 'reverse_resolve_domain' from the sibling list. It lacks context about prerequisites, exclusions, or typical use cases, offering only a basic functional statement.

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

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/buildwithgrove/mcp-pocket'

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