Skip to main content
Glama

getNFTOwner

Retrieve the Ethereum address that owns a specific ERC721 NFT token by providing the contract address and token ID. This tool queries blockchain data to identify current NFT ownership.

Instructions

Get the current owner of a specific ERC721 NFT token. Returns the Ethereum address that owns the specified token ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contractAddressYesThe address of the ERC721 contract
tokenIdYesThe ID of the token to check
providerNoOptional. The provider to use. If not provided, the default provider is used.
chainIdNoOptional. The chain ID to use.

Implementation Reference

  • Registration of the getNFTOwner MCP tool, including inline schema definition and handler function that queries the owner via ethersService and returns formatted response.
    server.tool(
      "getNFTOwner",
      "Get the current owner of a specific ERC721 NFT token. Returns the Ethereum address that owns the specified token ID.",
      {
        contractAddress: contractAddressSchema.describe("The address of the ERC721 contract"),
        tokenId: tokenIdSchema.describe("The ID of the token to check"),
        provider: providerSchema.describe("Optional. The provider to use. If not provided, the default provider is used."),
        chainId: chainIdSchema.describe("Optional. The chain ID to use.")
      },
      async (params) => {
        try {
          const owner = await ethersService.getERC721Owner(
            params.contractAddress,
            params.tokenId,
            params.provider,
            params.chainId
          );
          
          return {
            content: [{ 
              type: "text", 
              text: `Owner of token ${params.tokenId} is ${owner}`
            }]
          };
        } catch (error) {
          return {
            isError: true,
            content: [{ 
              type: "text", 
              text: `Error getting NFT owner: ${error instanceof Error ? error.message : String(error)}`
            }]
          };
        }
      }
    );
  • TypeScript type definition for the input parameters of the getNFTOwner tool.
    type GetNFTOwnerParams = {
      contractAddress: string;
      tokenId: string | number;
      provider?: string;
      chainId?: number;
    };
  • Call to registerERC721Tools function which includes the getNFTOwner tool registration.
    registerERC721Tools(server, ethersService);
  • src/mcpServer.ts:51-51 (registration)
    Top-level call to registerAllTools, which indirectly registers getNFTOwner via the tools index.
    registerAllTools(server, ethersService);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the return type ('Ethereum address') but lacks details on error conditions, rate limits, authentication requirements, or whether this is a read-only operation (though implied by 'Get'). More behavioral context is needed 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 perfectly concise with two sentences that directly state the purpose and return value. Every word earns its place, and it's front-loaded with the core functionality.

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 (4 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and return type but lacks usage guidelines, error handling, and behavioral details that would help an agent use it correctly in context with many sibling tools.

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 all parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain the relationship between contractAddress and tokenId). Baseline 3 is appropriate when the 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 specific action ('Get the current owner') and resource ('specific ERC721 NFT token'), distinguishing it from siblings like getNFTInfo or getNFTMetadata that provide different information. It precisely defines what the tool does.

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. While the purpose is clear, there's no mention of when to choose it over similar tools like getNFTInfo (which might include owner data) or how it relates to other NFT-related tools in the sibling list.

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/crazyrabbitLTC/mcp-ethers-server'

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