{
  "tools": [
    {
      "name": "get_install_commands",
      "title": "Get Install Commands",
      "description": "Return the exact install commands for Code Auditor for a given AI agent. Call this when a user asks how to install Code Auditor, or asks for the command for a specific agent (claude, cursor, codex, gemini, agents, zcode, or all).",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "agent": {
            "type": "string",
            "description": "The AI agent to install for (e.g. claude, cursor, codex, all)."
          }
        },
        "required": [
          "agent"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "agent": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "commands": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "agent",
          "displayName",
          "commands"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "lookup_rule",
      "title": "Look Up Rule",
      "description": "Return the rule kind, description, default severity, detection method, and threshold for a given Code Auditor rule or analyzer. Call this when a user asks what a specific rule does (e.g. import-ban, sql-injection, n+1).",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "rule_id": {
            "type": "string",
            "description": "Rule or analyzer id, e.g. import-ban, sql-injection, n+1."
          }
        },
        "required": [
          "rule_id"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      },
      "outputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "rule": {
                "type": "string"
              },
              "category": {
                "type": "string"
              },
              "severity": {
                "type": "string",
                "enum": [
                  "critical",
                  "severe",
                  "high"
                ]
              },
              "description": {
                "type": "string"
              },
              "method": {
                "type": "string"
              },
              "threshold": {
                "type": "string"
              },
              "config": {
                "type": "string"
              }
            },
            "required": [
              "rule",
              "category",
              "severity",
              "description",
              "method"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            },
            "required": [
              "error"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    {
      "name": "explain_symptom",
      "title": "Explain Symptom",
      "description": "Map a natural-language symptom (e.g. 'my app is slow', 'hardcoded password', 'infinite react loop') to the relevant Code Auditor rule(s) and their fixes. Call this when a user describes a problem rather than naming a rule.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "symptom": {
            "type": "string",
            "description": "A plain-language description of the problem."
          }
        },
        "required": [
          "symptom"
        ]
      },
      "annotations": {
        "readOnlyHint": true,
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "matches": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rule": {
                  "type": "string"
                },
                "category": {
                  "type": "string"
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "critical",
                    "severe",
                    "high"
                  ]
                },
                "description": {
                  "type": "string"
                },
                "method": {
                  "type": "string"
                },
                "threshold": {
                  "type": "string"
                },
                "config": {
                  "type": "string"
                }
              },
              "required": [
                "rule",
                "category",
                "severity",
                "description",
                "method"
              ],
              "additionalProperties": false
            }
          },
          "hint": {
            "type": "string"
          }
        },
        "required": [
          "matches"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "request_rule",
      "title": "Request Rule",
      "description": "Request a new Code Auditor rule. Call lookup_rule or explain_symptom first to confirm no existing rule covers it. Provide a minimal example that should be flagged and a corrected example that should not. Reduce both to the smallest code that shows the difference, and remove secrets and proprietary identifiers. Returns a receipt id.",
      "inputSchema": {
        "type": "object",
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 10,
            "maxLength": 120
          },
          "symptom": {
            "type": "string",
            "minLength": 40,
            "maxLength": 2000
          },
          "signal": {
            "type": "string",
            "minLength": 40,
            "maxLength": 2000
          },
          "languages": {
            "minItems": 1,
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "firingExample": {
            "minItems": 1,
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1
                },
                "content": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "path",
                "content"
              ]
            }
          },
          "cleanExample": {
            "minItems": 1,
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "minLength": 1
                },
                "content": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "path",
                "content"
              ]
            }
          },
          "toolVersion": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "symptom",
          "signal",
          "languages",
          "firingExample",
          "cleanExample"
        ]
      },
      "annotations": {
        "readOnlyHint": false,
        "destructiveHint": true,
        "idempotentHint": false,
        "openWorldHint": false
      },
      "outputSchema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "duplicateSubmission": {
            "type": "boolean"
          },
          "existingRuleMatches": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "duplicateSubmission",
          "existingRuleMatches"
        ],
        "additionalProperties": false
      }
    }
  ]
}