{
  "version": 1,
  "name": "IconPort agent tools",
  "description": "Search, retrieve, validate, and serialize icon or template records locally. The SVG preview is optional.",
  "execution": {
    "mode": "local",
    "module": "js/agent-tools.js",
    "export": "runTool",
    "signature": "runTool(request, catalog)",
    "moduleFiles": ["js/agent-tools.js", "js/catalog.js", "js/templates.js", "js/package.json"],
    "catalogs": {"icon": "icons.json", "template": "templates.json"},
    "instructions": "Resolve files against the site directory. Create a dedicated local tools directory and download all four moduleFiles into it, keeping their filenames. The included package.json declares ES module scope, including inside CommonJS projects. Import runTool locally; pass the relevant fetched catalog for search/get. Validate/render need only a record. No package installation or HTTP tool execution endpoint is involved.",
    "repositoryCommand": "npm run --silent agent",
    "cliProtocol": "Node.js 24+. One JSON request on stdin, one JSON response on stdout. Exit 0 for success, 1 for failure. Invalid requests are rejected before database access. Valid search/get requests use data/icons.json in the checkout. No files are written."
  },
  "response": {
    "success": {"ok": true, "result": "Action-specific result described below"},
    "failure": {"ok": false, "error": {"code": "Error code", "message": "Explanation"}},
    "errorCodes": ["invalid_request", "invalid_catalog", "not_found", "invalid_record", "invalid_json"]
  },
  "tools": [
    {
      "name": "search",
      "description": "Find candidates by name, category, tags, and template title. Every query word must match. Exact names rank first. Returns metadata only and never selects a result automatically.",
      "inputSchema": {
        "type": "object",
        "required": ["action", "kind", "query"],
        "additionalProperties": false,
        "properties": {
          "action": {"const": "search"},
          "kind": {"enum": ["icon", "template"]},
          "query": {"type": "string", "minLength": 1, "description": "Nonblank name, template title, or keywords; .svg suffix, spaces, hyphens, and underscores are supported."},
          "category": {"type": "string", "description": "Optional category; ignores case and surrounding spaces."}
        }
      },
      "result": "{matches: [{name, category, tags, title?}], count}. No geometry is returned. An empty matches array means no match."
    },
    {
      "name": "get",
      "description": "Retrieve a full independent copy of an exact catalog record, including paths for icons or elements and editing notes for templates.",
      "inputSchema": {
        "type": "object",
        "required": ["action", "kind", "name"],
        "additionalProperties": false,
        "properties": {
          "action": {"const": "get"},
          "kind": {"enum": ["icon", "template"]},
          "name": {"type": "string", "pattern": "^[a-z][a-z0-9-]*$", "description": "Exact lowercase catalog name, without a .svg suffix."}
        }
      },
      "result": "The complete record. A missing name returns not_found; no replacement is selected."
    },
    {
      "name": "validate",
      "description": "Check an edited record with the same schema and allowlists used by the site build. Fields are case-sensitive; unsupported fields on records, template elements, and editing notes are rejected. Does not require a catalog or write changes.",
      "inputSchema": {
        "type": "object",
        "required": ["action", "kind", "record"],
        "additionalProperties": false,
        "properties": {
          "action": {"const": "validate"},
          "kind": {"enum": ["icon", "template"]},
          "record": {"type": "object", "description": "A full icon or template record, typically obtained with get and edited locally."}
        }
      },
      "result": "{valid: true, name}. Invalid records return invalid_record."
    },
    {
      "name": "render",
      "description": "Validate a record and serialize standalone SVG. Escapes text and preserves geometry. This generates markup, not a raster image or visual inspection.",
      "inputSchema": {
        "type": "object",
        "required": ["action", "kind", "record"],
        "additionalProperties": false,
        "properties": {
          "action": {"const": "render"},
          "kind": {"enum": ["icon", "template"]},
          "record": {"type": "object", "description": "A full icon or template record. Update labels, geometry, title, and description together when changing meaning."}
        }
      },
      "result": "{name, svg}. Icons use their 24-by-24 viewBox and catalog rendering defaults. Templates use their own dimensions and explicit colors."
    }
  ],
  "limitations": [
    "Validation checks the supported record schema and SVG path syntax, including complete commands, finite numbers, separators, and arc flags. It does not check visual layout, statistical correctness, or text fit.",
    "Render accepts structured records, not arbitrary SVG markup. Use the SVG preview only when a person needs to inspect or edit SVG visually.",
    "Tools are ordinary local JavaScript functions and a repository CLI; this manifest does not register an MCP server."
  ],
  "instructions": "agents.html#tools-title",
  "license": "GPL-3.0-only"
}
