Skip to main content
Glama
ymylive
by ymylive

get_nft_collection

Get detailed NFT collection data: floor price, market cap, volume, unique holders, total supply, and links. Provide a CoinGecko NFT ID to receive current metrics and market insights.

Instructions

Get detailed data for a single NFT collection: floor price, market cap, volume, holders, links.

Args: nft_id: CoinGecko NFT collection ID, e.g. "bored-ape-yacht-club", "cryptopunks". Use search or list_nfts to find IDs.

Returns: NFT collection object with floor_price, market_cap, volume_24h, floor_price_in_usd_24h_percentage_change, number_of_unique_addresses, total_supply, links, image, etc.

Note: nft_id is validated against ^[a-z0-9][a-z0-9._-]{0,127}$.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nft_idYes

Implementation Reference

  • The actual handler function for the get_nft_collection tool. Validates nft_id then calls CoinGecko API GET /nfts/{nft_id}.
    async def get_nft_collection(nft_id: str) -> Any:
        """Get detailed data for a single NFT collection: floor price, market cap, volume, holders, links.
    
        Args:
            nft_id: CoinGecko NFT collection ID, e.g. "bored-ape-yacht-club",
                "cryptopunks". Use `search` or `list_nfts` to find IDs.
    
        Returns:
            NFT collection object with `floor_price`, `market_cap`, `volume_24h`,
            `floor_price_in_usd_24h_percentage_change`, `number_of_unique_addresses`,
            `total_supply`, `links`, `image`, etc.
    
        Note: `nft_id` is validated against `^[a-z0-9][a-z0-9._-]{0,127}$`.
        """
        err = _validate_id(nft_id, "nft_id")
        if err is not None:
            return err
        return await _cg_get(f"/nfts/{nft_id}")
  • Registration of get_nft_collection via @mcp.tool() decorator from the shared FastMCP instance.
    @mcp.tool()
    async def get_nft_collection(nft_id: str) -> Any:
  • Helper function _validate_id used to validate nft_id input against path-injection regex.
    def _validate_id(value: str, kind: str = "id") -> dict | None:
        """Return None when valid, or a JSON error dict when not.
    
        Used to harden tools that interpolate caller-supplied strings into URL
        paths against path traversal / query-param smuggling.
        """
        if not isinstance(value, str) or not _ID_RE.match(value):
            return {
                "error": (
                    f"invalid {kind}: must match ^[a-z0-9][a-z0-9._-]{{0,127}}$, "
                    f"got {value!r}"
                )
            }
        return None
  • Core HTTP helper _cg_get that constructs the CoinGecko API URL and makes the request for the handler.
    async def _cg_get(path: str, params: dict[str, Any] | None = None) -> Any:
        return await _http_get(
            f"{_coingecko_base()}{path}",
            params=params,
            headers=_coingecko_headers(),
        )
  • Schema documentation for the tool's input parameter nft_id and return type.
        nft_id: CoinGecko NFT collection ID, e.g. "bored-ape-yacht-club",
            "cryptopunks". Use `search` or `list_nfts` to find IDs.
    
    Returns:
        NFT collection object with `floor_price`, `market_cap`, `volume_24h`,
        `floor_price_in_usd_24h_percentage_change`, `number_of_unique_addresses`,
        `total_supply`, `links`, `image`, etc.
    
    Note: `nft_id` is validated against `^[a-z0-9][a-z0-9._-]{0,127}$`.
    """
Behavior3/5

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

No annotations provided, so description must cover behavioral aspects. It details return fields and validation of nft_id, but does not mention error behavior or side effects. Adequate but not thorough.

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?

Well-structured with a one-line summary, explicit Args/Returns sections, and a Note. Every sentence adds value, no fluff.

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

Completeness5/5

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

For a simple read tool with one parameter and no output schema, the description covers the purpose, parameter details, and return contents completely. No missing information.

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

Parameters5/5

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

Schema coverage is 0%, but description fully explains the nft_id parameter: what it represents, examples, how to find valid IDs, and regex validation. Adds substantial meaning beyond the schema.

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?

Clearly states it gets detailed data for a single NFT collection, listing specific metrics like floor price and market cap. Distinguishes from sibling tools like list_nfts (multiple) and get_coin_details (coins).

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?

Recommends using search or list_nfts to find the nft_id. Does not explicitly state when not to use it, but the guidance for ID discovery is helpful.

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/ymylive/coin-mcp'

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