Get README badge code
get_badge_codeGenerate 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
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | Exact slug of an approved public Codex pet. |
Implementation Reference
- packages/cli/src/mcp.js:72-78 (handler)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, }; - packages/cli/src/mcp.js:171-181 (registration)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))), );