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

  • Main tool handler for get_badge_code - delegates to handleApprovedPetTool which fetches the approved pet by slug and returns badge data (markdown, html, svgUrl).
    async (args) => {
      return handleApprovedPetTool("get_badge_code", args.slug, (pet) => ({
        slug: pet.slug,
        name: pet.name,
        badge: pet.badge,
      }));
    },
  • Registration of get_badge_code tool on the MCP server with title, description, input schema (slug), and read-only annotations.
    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: slugInputSchema,
        annotations: READ_ONLY_TOOL,
      },
  • 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))),
    );
  • Helper that builds the AgentBadgeCode object containing markdown, HTML, and svgUrl for a pet badge.
    export function buildAgentBadgeCode(input: {
      name: string;
      pageUrl: string;
      svgUrl: string;
    }): AgentBadgeCode {
      const alt = `Codex pet: ${input.name}`;
    
      return {
        markdown: `[![${escapeMarkdownAlt(alt)}](${input.svgUrl})](${input.pageUrl})`,
        html: `<a href="${escapeHtmlAttribute(input.pageUrl)}"><img alt="${escapeHtmlAttribute(alt)}" src="${escapeHtmlAttribute(input.svgUrl)}"></a>`,
        svgUrl: input.svgUrl,
      };
    }
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, so safety profile is clear. Description adds that it works only for 'approved public Codex pet slugs,' but no further behavioral details (e.g., error handling, rate limits). Adequate given 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?

Two sentences. First sentence directly states purpose. Second sentence lists exclusions and alternatives. No filler words, front-loaded with the core action.

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, no-output-schema tool, the description covers usage scope and constraints. Annotations handle behavioral safety. The description is sufficient for an agent to select and invoke correctly.

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% for the single required parameter 'slug', which is described as 'Exact slug of an approved public Codex pet.' The description does not add additional meaning beyond that, so baseline 3 applies.

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 'get README badge Markdown, HTML, or SVG URL' for a known approved pet slug, specifying the exact resource and action. It also distinguishes from siblings by listing what not to use it for and providing alternative tool names.

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 states when to use ('when user needs README badge...') and when not to use (animated cards, iframes, etc.), with specific alternative tools listed (get_card_code, get_embed_code, etc.).

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/astandrik/codex-pets'

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