Skip to main content
Glama
astandrik

Codex Pets

Get README badge code

get_badge_code
Read-onlyIdempotent

Generate README badge Markdown, HTML, or SVG URL for any approved public Codex pet using its exact slug.

Instructions

Use for a known approved pet slug when the user needs README badge Markdown, HTML, or SVG URL. Do not use for animated README cards, website iframe embeds, install instructions, or pet discovery; use get_card_code, get_embed_code, get_install_instructions, or search_pets instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugYesExact slug of an approved public Codex pet.

Implementation Reference

  • CLI alternative handler - fetches share payload from API and returns badge data (markdown, html, svgUrl) for the given slug.
    async getBadgeCode(slug) {
      const share = await fetchSharePayload(fetchImpl, baseUrl, slug);
      return {
        slug: share.pet.slug,
        name: share.pet.name,
        badge: share.share.badge,
      };
  • CLI-side registration of get_badge_code tool on the local MCP server.
    server.registerTool(
      "get_badge_code",
      {
        title: "Get README badge code",
        description:
          "Use for a known approved pet slug when the user needs README badge Markdown, HTML, or SVG URL. Do not use for animated README cards, website iframe embeds, install instructions, or pet discovery; use get_card_code, get_embed_code, get_install_instructions, or search_pets instead.",
        inputSchema: slugSchema,
        annotations: READ_ONLY_TOOL,
      },
      async (args) => runTool(() => dataSource.getBadgeCode(readSlug(args.slug))),
    );

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.1
    • changedInput schema / properties / slug / description
      Previous value: -"Approved Codex pet slug."New value: +"Exact slug of an approved public Codex pet."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already indicate read-only, idempotent, non-destructive behavior. Description adds that output includes Markdown, HTML, or SVG URL, which are behavioral details not covered by annotations. Could mention more about prerequisites or error handling, but sufficient given annotations.

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?

Two sentences, front-loaded with purpose, second sentence providing exclusions and alternatives. No wasted words.

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 one-parameter tool with no output schema, the description covers what it returns, constraints (approved pet slug), and when to avoid. Complete given the tool's simplicity and rich annotations.

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 coverage is 100%, so the parameter 'slug' is fully documented. The description reinforces that it must be an exact slug of an approved pet but adds no new semantic detail 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?

The description clearly states the tool's purpose: generating README badge Markdown, HTML, or SVG URL for a known approved pet slug. It distinguishes from siblings by explicitly naming alternatives for other use cases.

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

Usage Guidelines5/5

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

Explicitly provides when to use (known approved pet slug, need badge code) and when not to use (animated cards, iframe embeds, install instructions, pet discovery), listing specific alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.