Report tool
The ReportTool, which an agent sees as WriteReport, turns findings already gathered into a document you can export, print, and hand over.
It assembles. Given three findings it emits three findings. An empty section is left empty and labelled empty. Every section names the tool it came from, and the report carries the moment it was assembled. The document is the tool's return value (markdown or HTML in the execute response). Index it yourself if you want it stored.
If you pass classification, that marking appears at the head and foot of the document. If you omit it, the report states that no handling marking was supplied, in the same place.
generated_at is the moment the report speaks about. Pass it as ISO-8601 or a plain date.
Parameters
| Parameter | Required | Description |
|---|---|---|
title | Yes | The report title. |
sections | No | String. A JSON array of {heading, body, source} objects, passed as a string on _execute. Omit it for an empty report that states no findings were supplied. |
images | No | String. A JSON array of {caption, uri} objects, passed as a string on _execute. |
classification | No | Handling marking printed at the head and foot. |
prepared_for | No | Who the report is for. |
prepared_by | No | Who or what prepared it. |
generated_at | No | The moment the report speaks about. |
format | No | markdown (default) or html. |
Register a flow agent that runs the ReportTool
POST /_plugins/_agent/agents/_register
{
"name": "Report_Agent",
"type": "flow",
"description": "assembles findings into a report",
"tools": [
{
"type": "ReportTool",
"name": "DemoWriteReport",
"parameters": {
"format": "markdown"
}
}
]
}
POST /_plugins/_agent/agents/<agent_id>/_execute
{
"parameters": {
"title": "Weekly land-cover changes",
"prepared_for": "partner-a",
"prepared_by": "Land_Cover_Analyst",
"generated_at": "2024-07-19",
"sections": "[{\"heading\":\"Almond change\",\"body\":\"Almonds grew from 1.84e6 to 2.10e6 square metres between 2024-07-12 and 2024-07-19.\",\"source\":\"FindChanges\"},{\"heading\":\"Extent\",\"body\":\"Sample features fall in the Central Valley AOI.\",\"source\":\"FindFeatures\"}]"
}
}
sections is a JSON array passed as a string. Each object has heading, body, and source (the tool that produced the finding). A conversational agent fills title and sections from earlier tool answers; a flow agent passes them on _execute.