Skip to main content
Glama

get_erc1155_token_uri

Retrieve the metadata URI for a specific ERC1155 token, which points to JSON data about the token's properties, including its contract address and ID, across Ethereum-compatible networks.

Instructions

Get the metadata URI for an ERC1155 token (multi-token standard used for both fungible and non-fungible tokens). The URI typically points to JSON metadata about the token.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoNetwork name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. ERC1155 tokens exist across many networks. Defaults to Ethereum mainnet.
tokenAddressYesThe contract address of the ERC1155 token collection (e.g., '0x76BE3b62873462d2142405439777e971754E8E77')
tokenIdYesThe ID of the specific token to query metadata for (e.g., '1234')

Implementation Reference

  • The main handler function that implements the logic to fetch the ERC1155 token URI by calling the contract's 'uri' method using viem's getContract and read functionality.
    /**
     * Get ERC1155 token URI
     */
    export async function getERC1155TokenURI(
      tokenAddress: Address,
      tokenId: bigint,
      network: string = 'ethereum'
    ): Promise<string> {
      const publicClient = getPublicClient(network);
    
      const contract = getContract({
        address: tokenAddress,
        abi: erc1155Abi,
        client: publicClient,
      });
    
      return contract.read.uri([tokenId]);
    } 
  • The ABI definition used by the handler to interact with the ERC1155 contract's uri function.
    // Standard ERC1155 ABI (minimal for reading)
    const erc1155Abi = [
      {
        inputs: [{ type: 'uint256', name: 'id' }],
        name: 'uri',
        outputs: [{ type: 'string' }],
        stateMutability: 'view',
        type: 'function'
      }
    ] as const;
Behavior2/5

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

No annotations are provided, so the description carries full burden. It describes what the tool does (retrieves a metadata URI) but doesn't disclose behavioral traits like whether it's a read-only operation, potential rate limits, error conditions, or what happens if the token doesn't exist. For a tool with zero annotation coverage, this is a significant gap.

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 that each add value. The first sentence states the core purpose, and the second explains what the URI typically contains. There's no wasted text, though it could be slightly more front-loaded with usage guidance.

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 3 parameters with full schema coverage but no annotations and no output schema, the description is minimally adequate. It explains the purpose and typical output format, but doesn't address behavioral aspects or provide usage guidance relative to siblings. For a read operation with good schema documentation, it meets basic needs but has clear gaps.

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 fully documents all three parameters. The description doesn't add any parameter-specific information beyond what's in the schema. According to guidelines, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 metadata URI') and resource ('for an ERC1155 token'), and distinguishes it from siblings by specifying it's for the ERC1155 standard (unlike get_nft_info or get_token_info which might handle other token types). It also explains what the URI typically contains, adding useful context.

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

Usage Guidelines3/5

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

The description implies usage by mentioning the ERC1155 standard and typical URI content, but doesn't explicitly state when to use this tool versus alternatives like get_nft_info or get_token_info. It provides some context but lacks clear guidance on tool selection among siblings.

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/mcpdotdirect/evm-mcp-server'

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