Tools

get_icon_url

Resolve a composed-icon URL for an element + optional variant.

get_icon_url

Handy when you want a single URL to hand off to an image renderer or <img> tag. The returned URL is the REST icon route.

Summary

Given a (version, element_id, variant?) triple, returns the composed-icon URL, the content type, and the full valid_variants list for that element. The returned URL is relative (/api/v2/…); prefix https://api.dtpr.io to fetch.

Input

FieldTypeRequiredDescription
versionstringyesSchema version.
element_idstringyesWhitelisted to [a-zA-Z0-9_-].
variantstringnoVariant key. Omit for the default icon.

Output

{
  "ok": true,
  "data": {
    "url": "/api/v2/schemas/ai@2026-04-16-beta/elements/purpose.example/icon.svg",
    "content_type": "image/svg+xml",
    "variant": "default",
    "valid_variants": ["default", "dark", "commercial", "civic"]
  },
  "meta": { "content_hash": "sha256-…", "version": "ai@2026-04-16-beta" }
}

Errors

CodeMeaningFix
invalid_argumentsMissing / malformed arguments.Fix the call.
unknown_versionVersion is not registered.Call list_schema_versions.
element_not_foundNo element with that id.Use list_elements.
unknown_variantVariant not valid for this element.Inspect valid_variants in the error meta or read icon_variants via get_element.

Example

curl -s https://api.dtpr.io/mcp \
  -H 'content-type: application/json' \
  --data '{
    "jsonrpc":"2.0","id":1,
    "method":"tools/call",
    "params":{
      "name":"get_icon_url",
      "arguments":{
        "version":"ai@2026-04-16-beta",
        "element_id":"purpose.example",
        "variant":"dark"
      }
    }
  }'

See also

Copyright © 2026