{
  "$comment": "A discovery card, not an endpoint. WebMCP tools live in the page and exist only while a tab is open, so there is no URL to POST to and this file does not pretend there is: `transport` says `webmcp-in-page` and names the page to open. Every name, description and schema below is copied from the same catalogue the page registers from, at packages/tools/src/catalogue.ts, so a tool listed here and a tool offered by the page cannot drift apart without the build failing.",
  "name": "jig",
  "title": "Jig, the knitting pattern workbench",
  "version": "0.1.0",
  "description": "A knitting pattern workbench where a designer and an AI agent edit the same document through one gate. Every write is checked against stitch repeats, whole increase rounds, whole rows and monotonic grading, and an invalid write is refused with the rule it broke and the nearest values that do fit.",
  "license": "MIT",
  "repository": "https://github.com/EmadQureshiKhi/jig",
  "documentation": "https://jig-workbench.pages.dev/llms.txt",
  "transport": {
    "type": "webmcp-in-page",
    "page": "https://jig-workbench.pages.dev/",
    "registeredOn": "document.modelContext",
    "note": "Open the page and read document.modelContext.getTools(). Tools are registered per tab and are not reachable over HTTP. Where the browser has no WebMCP host, the page installs one with the same surface, and says which one you have."
  },
  "capabilities": { "tools": { "listChanged": true } },
  "tools": [
    {
      "name": "read_pattern",
      "description": "Read the pattern: gauge, per size measurements in inches, stitch and row counts, and shaping. Use before changing anything, and to report where the pattern stands.",
      "annotations": { "readOnlyHint": true, "untrustedContentHint": false },
      "inputSchema": {
        "type": "object",
        "properties": {
          "size": { "type": "string", "description": "A size label such as M. Left out, every size is read." }
        }
      }
    },
    {
      "name": "read_chart",
      "description": "Read a charted panel, either as a grid of symbols or linearised row by row in words for a screen reader.",
      "annotations": { "readOnlyHint": true, "untrustedContentHint": false },
      "inputSchema": {
        "type": "object",
        "required": ["panel"],
        "properties": {
          "panel": { "type": "string", "description": "The panel label, such as cable." },
          "form": { "type": "string", "enum": ["grid", "text"], "description": "How to render it." }
        }
      }
    },
    {
      "name": "audit_pattern",
      "description": "Check the whole pattern for contradictions and report each one with the rule it breaks. Export is withheld while any stand.",
      "annotations": { "readOnlyHint": true, "untrustedContentHint": false },
      "inputSchema": { "type": "object", "properties": {} }
    },
    {
      "name": "export_pattern",
      "description": "Export the finished pattern. Not offered at all while the audit reports a contradiction, so there is no call to refuse.",
      "annotations": { "readOnlyHint": true, "untrustedContentHint": false },
      "inputSchema": {
        "type": "object",
        "properties": {
          "format": { "type": "string", "enum": ["plain", "markdown"], "description": "Which format to write." }
        }
      }
    },
    {
      "name": "set_gauge",
      "description": "Set the stitch and row gauge from a measured swatch, over four inches, and recompute every count that depends on it.",
      "annotations": { "readOnlyHint": false, "untrustedContentHint": false },
      "inputSchema": {
        "type": "object",
        "required": ["stsPer4in", "rowsPer4in"],
        "properties": {
          "stsPer4in": { "type": "number", "description": "Stitches over four inches." },
          "rowsPer4in": { "type": "number", "description": "Rows over four inches." }
        }
      }
    },
    {
      "name": "grade_sizes",
      "description": "Grade the size run from a sample size across a range of finished bust measurements, in inches.",
      "annotations": { "readOnlyHint": false, "untrustedContentHint": false },
      "inputSchema": {
        "type": "object",
        "required": ["fromSize", "minBustIn", "maxBustIn"],
        "properties": {
          "fromSize": { "type": "string", "description": "The sample size label to grade from." },
          "minBustIn": { "type": "number", "description": "Smallest body bust, in inches." },
          "maxBustIn": { "type": "number", "description": "Largest body bust, in inches." }
        }
      }
    },
    {
      "name": "edit_number",
      "description": "Change one number on one size. Refused with the rule it breaks and the nearest values that do fit, rather than silently rounded.",
      "annotations": { "readOnlyHint": false, "untrustedContentHint": false },
      "inputSchema": {
        "type": "object",
        "required": ["size", "field", "value"],
        "properties": {
          "size": { "type": "string", "description": "The size label to change." },
          "field": { "type": "string", "description": "Which number, such as yokeCastOn." },
          "value": { "type": "number", "description": "The new value, in stitches, rows or inches depending on the field." }
        }
      }
    },
    {
      "name": "substitute_yarn",
      "description": "Swap the yarn and recount whole skeins. Reaches the yarn service on a separate origin over WebMCP, and any community text that comes back is held as untrusted.",
      "annotations": { "readOnlyHint": false, "untrustedContentHint": true },
      "inputSchema": {
        "type": "object",
        "required": ["yarnId"],
        "properties": {
          "yarnId": { "type": "string", "description": "A yarn id from the yarn service, such as hedgerow-dk." }
        }
      }
    },
    {
      "name": "check_panel_fit",
      "description": "Test a stitch count against the selected chart panel. Offered only while a panel is selected and withdrawn when it is deselected.",
      "annotations": { "readOnlyHint": true, "untrustedContentHint": false },
      "inputSchema": {
        "type": "object",
        "required": ["stitches"],
        "properties": {
          "stitches": { "type": "integer", "description": "A stitch count to test." }
        }
      }
    },
    {
      "name": "set_chart_cell",
      "description": "Change one symbol in the chart. Offered only while a chart panel is selected.",
      "annotations": { "readOnlyHint": false, "untrustedContentHint": false },
      "inputSchema": {
        "type": "object",
        "required": ["row", "column", "symbol"],
        "properties": {
          "row": { "type": "integer", "description": "Chart row, counting from the bottom." },
          "column": { "type": "integer", "description": "Chart column, counting from the right." },
          "symbol": { "type": "string", "description": "The stitch symbol to place." }
        }
      }
    }
  ],
  "relatedServices": [
    {
      "name": "jig-yarn-service",
      "page": "https://jig-yarn-service.pages.dev/",
      "description": "A separate origin holding the yarn catalogue. Registers three read only tools, exposed to the workbench origin and to nothing else.",
      "tools": ["yarns_find_yarn", "yarns_yarn_profile", "yarns_substitution_candidates"]
    }
  ]
}
