TOOL DEFINITION — TEMPLATE
==========================
Version 1.0 — 2026-10-17

TEMPLATE ONLY. JSON definitions for tools exposed to an AI model. Two
common shapes are shown: OpenAI function calling and Anthropic tool use.
Replace every [PLACEHOLDER].

Guidelines:
- The description is the model's documentation; write it for a careful
  engineer who cannot see the implementation.
- Use enums and strict schemas; reject unknown fields.
- Return small, stable results; never return secrets or unbounded data.
- Make destructive actions explicit and require confirmation arguments.

---
OPENAI FUNCTION CALLING
-----------------------
{
  "type": "function",
  "function": {
    "name": "read_original_file",
    "description": "Read the full text of a file published on original.wales. Use the id from /cli/manifest.tsv. Returns plain text and SHA-256 metadata.",
    "strict": true,
    "parameters": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable file id, for example mit-license."
        },
        "max_chars": {
          "type": "integer",
          "description": "Maximum characters to return. Defaults to 20000.",
          "minimum": 1,
          "maximum": 200000
        }
      },
      "required": ["id"],
      "additionalProperties": false
    }
  }
}

ANTHROPIC TOOL USE
------------------
{
  "name": "read_original_file",
  "description": "Read the full text of a file published on original.wales. Use the id from /cli/manifest.tsv. Returns plain text and SHA-256 metadata.",
  "input_schema": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "Stable file id, for example mit-license."
      },
      "max_chars": {
        "type": "integer",
        "description": "Maximum characters to return. Defaults to 20000.",
        "minimum": 1,
        "maximum": 200000
      }
    },
    "required": ["id"]
  }
}

CHECKLIST
---------
- [ ] Name is a verb + noun, lower_snake_case.
- [ ] Description states what it does, when to use it, and what it returns.
- [ ] Every parameter has a description and a type.
- [ ] Required fields are truly required.
- [ ] additionalProperties: false where supported.
- [ ] Errors are documented and non-destructive.
- [ ] The tool cannot be tricked into reading unrelated data.
- [ ] Tested against malformed arguments.

SOURCES
-------
OpenAI function calling: https://platform.openai.com/docs/guides/function-calling
Anthropic tool use: https://docs.anthropic.com/en/docs/build-with-claude/tool-use
JSON Schema: https://json-schema.org/
