Skip to main content
Glama
fengshanshan

Related Identity MCP Server

by fengshanshan

get-related-address

Find cross-platform accounts and addresses linked to a specific blockchain or social identity to discover all related profiles and connections.

Instructions

Retrieves all related identities associated with a specific platform identity. This tool helps discover cross-platform connections for the same person or entity. Use cases include: 1) Finding all accounts (Lens, Farcaster, ENS, etc.) belonging to the same person, 2) Resolving domain names to their underlying addresses (ENS domains, Lens handles, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesThe platform of a specific identity, e.g.: Ethereum, Farcaster, lens, ens
identityYesUser's identity

Implementation Reference

  • The main handler function for the 'get-related-address' tool. It validates and normalizes the input platform and identity, executes a GraphQL query to fetch related identities and addresses, formats the response, and handles errors appropriately.
    async ({ platform, identity }) => {
      try {
        // Input validation and sanitization
        const normalizedPlatform = platform.toLowerCase().trim();
        const normalizedIdentity = identity.trim();
    
        if (!normalizedIdentity) {
          throw new Error("Identity cannot be empty");
        }
    
        // Execute GraphQL query
        const data = await executeGraphQLQuery({
          query: IDENTITY_QUERY,
          variables: {
            platform: normalizedPlatform,
            identity: normalizedIdentity,
          },
        });
    
        return {
          content: [
            {
              type: "text",
              text: `The related information is: ${JSON.stringify(data)}`,
            },
          ],
        };
      } catch (err) {
        const error = err as Error;
        console.error(`Error in get-related-address: ${error.message}`);
    
        return {
          content: [
            {
              type: "text",
              text: `Error fetching data: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the tool parameters: platform (enum or string) and identity (string). Uses Zod for validation.
    {
      platform: PlatformSchema.describe(
        "The platform of a specific identity, e.g.: Ethereum, Farcaster, lens, ens"
      ),
      identity: IdentitySchema.describe("User's identity"),
    },
  • src/index.ts:236-287 (registration)
    Full registration of the 'get-related-address' tool on the MCP server, including name, description, input schema, and inline handler function.
    server.tool(
      "get-related-address",
      "Retrieves all related identities associated with a specific platform identity. This tool helps discover cross-platform connections for the same person or entity. Use cases include: 1) Finding all accounts (Lens, Farcaster, ENS, etc.) belonging to the same person, 2) Resolving domain names to their underlying addresses (ENS domains, Lens handles, etc.)",
      {
        platform: PlatformSchema.describe(
          "The platform of a specific identity, e.g.: Ethereum, Farcaster, lens, ens"
        ),
        identity: IdentitySchema.describe("User's identity"),
      },
      async ({ platform, identity }) => {
        try {
          // Input validation and sanitization
          const normalizedPlatform = platform.toLowerCase().trim();
          const normalizedIdentity = identity.trim();
    
          if (!normalizedIdentity) {
            throw new Error("Identity cannot be empty");
          }
    
          // Execute GraphQL query
          const data = await executeGraphQLQuery({
            query: IDENTITY_QUERY,
            variables: {
              platform: normalizedPlatform,
              identity: normalizedIdentity,
            },
          });
    
          return {
            content: [
              {
                type: "text",
                text: `The related information is: ${JSON.stringify(data)}`,
              },
            ],
          };
        } catch (err) {
          const error = err as Error;
          console.error(`Error in get-related-address: ${error.message}`);
    
          return {
            content: [
              {
                type: "text",
                text: `Error fetching data: ${error.message}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • Helper function to execute GraphQL queries against the web3.bio API with timeout, auth, and error handling. Used by the tool handler.
    async function executeGraphQLQuery(query: GraphQLQuery): Promise<any> {
      const response = await fetchWithTimeout(
        API_ENDPOINT,
        {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            "User-Agent": "relate-account-mcp/3.0.0",
            ...(process.env.ACCESS_TOKEN && {
              Authorization: process.env.ACCESS_TOKEN,
            }),
          },
          body: JSON.stringify(query),
        },
        REQUEST_TIMEOUT
      );
    
      if (!response.ok) {
        throw new Error(`HTTP ${response.status}: ${response.statusText}`);
      }
    
      const json = await response.json();
    
      if (json.errors) {
        throw new Error(
          `GraphQL errors: ${json.errors.map((e: any) => e.message).join(", ")}`
        );
      }
    
      return json.data;
    }
  • GraphQL query template for fetching identity details including resolved addresses, owner/manager addresses, profiles, and full identity graph connections.
    const IDENTITY_QUERY = `
      query QUERY_PROFILE($platform: Platform!, $identity: String!) {
        identity(platform: $platform, identity: $identity) {
          id
          status
          aliases
          identity
          platform
          network
          isPrimary
          primaryName
          resolvedAddress {
            address
            network
          }
          ownerAddress {
            address
            network
          }
          managerAddress {
            address
            network
          }
          updatedAt
          profile {
            identity
            platform
            network
            address
            displayName
            avatar
            description
            addresses {
              address
              network
            }
          }
          identityGraph {
            graphId
            vertices {
              identity
              platform
              network
              isPrimary
              primaryName
              registeredAt
              managerAddress {
                address
                network
              }
              ownerAddress {
                address
                network
              }
              resolvedAddress {
                address
                network
              }
              updatedAt
              expiredAt
              profile {
                uid
                identity
                platform
                network
                address
                displayName
                avatar
                description
                texts
                addresses {
                  address
                  network
                }
              }
            }
          }
        }
      }
    `;
Behavior3/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. It describes the tool's function well but lacks details on permissions, rate limits, error conditions, or response format. The description doesn't contradict annotations (none exist), but it's incomplete for a tool that likely queries external services.

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 appropriately sized with two sentences: one stating the core purpose and one listing use cases. It's front-loaded with the main function and avoids unnecessary elaboration. The bullet-style use cases are efficient, though slightly unconventional in flow.

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?

For a tool with 2 parameters, 100% schema coverage, and no output schema, the description is adequate but has gaps. It explains the purpose and use cases well but lacks behavioral details (rate limits, permissions, response format) that would be helpful given the tool likely queries multiple external platforms. The absence of output schema increases the need for return value explanation.

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 context about what the parameters represent ('platform identity', 'cross-platform connections'), but doesn't provide additional syntax or format details beyond what the schema provides. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('retrieves', 'discover', 'finding', 'resolving') and resources ('related identities', 'cross-platform connections', 'accounts', 'domain names'). It distinguishes the tool's function by explaining it finds connections across multiple platforms for the same person/entity, which is specific and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit use cases (finding accounts across platforms, resolving domains to addresses) that clarify when to use this tool. However, it doesn't mention when NOT to use it or alternatives, and with no sibling tools, differentiation isn't needed. The guidance is clear but lacks exclusions.

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/fengshanshan/relate-account-mcp'

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