Record an agent's tool call in the change feed (`tool_call` events): what an MCP server reports after each call, its own tools included (`served_by`). Any token may call it.
const url = 'https://example.com/datanotes/tool-calls/record/';const options = { method: 'POST', headers: { 'X-Datanotes-Actor': '{"harness":"my-script","model":"","session":"s-1"}', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"tool":"example","args":{},"ok":true,"duration_ms":1,"value":"example","served_by":"example","session":"example","result_chars":1,"result_tokens":1,"summary":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/datanotes/tool-calls/record/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'X-Datanotes-Actor: {"harness":"my-script","model":"","session":"s-1"}' \ --data '{ "tool": "example", "args": {}, "ok": true, "duration_ms": 1, "value": "example", "served_by": "example", "session": "example", "result_chars": 1, "result_tokens": 1, "summary": {} }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”JSON: on whose behalf the write is made, recorded in the journal (harness, model, session).
Example
{"harness":"my-script","model":"","session":"s-1"}Request Bodyrequired
Section titled “Request Bodyrequired”object
object
The result’s summary, when value is sent already cut: the engine records it (the answer says takes_summary).
object
Example generated
{ "tool": "example", "args": {}, "ok": true, "duration_ms": 1, "value": "example", "served_by": "example", "session": "example", "result_chars": 1, "result_tokens": 1, "summary": {}}Responses
Section titled “Responses”Done.
object
The engine records a value sent cut with its summary: a reporter may send them so.
Example
{ "ok": true}Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Missing or wrong bearer token.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}The session belongs to another named token: the first token to report a session owns it (compared on its first 16 characters), and only that token and the owner may report it again. Nothing is stored.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Unexpected error.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}