{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jambonz.org/schema/commands/llm:tool-output",
  "title": "LLM Tool Output Command",
  "description": "Command sent from the application to feature-server over the session websocket, carrying the result of a tool invocation that the LLM initiated during an agent verb. Sent in response to an `agent:tool-call` event. The result is fed back into the LLM so it can continue generating using the tool output.",
  "type": "object",
  "required": ["type", "command", "tool_call_id", "data"],
  "properties": {
    "type": { "const": "command" },
    "command": { "const": "llm:tool-output" },
    "tool_call_id": {
      "type": "string",
      "minLength": 1,
      "description": "The tool_call_id echoed from the originating `agent:tool-call` event."
    },
    "data": {
      "type": "object",
      "description": "Tool output payload. `{result: ...}` is the canonical shape — the wrapped value is what the LLM sees as the tool's return value. Other object shapes are accepted (they're JSON-stringified as-is into the tool_result content block on the wire) but `result` is preferred for clarity.",
      "properties": {
        "result": {}
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "type": "command",
      "command": "llm:tool-output",
      "tool_call_id": "toolu_017NKXtgnD7fuo1KaTeSM1ok",
      "data": {
        "result": "The current temperature in Boston is 9.3°C with wind speed 17 km/h."
      }
    }
  ]
}
