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.
POST
/datanotes/tool-calls/record/
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}'};
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 }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”X-Datanotes-Actor
string
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”Media typeapplication/json
object
tool
required
string
args
object
ok
boolean
duration_ms
number
value
served_by
string
session
string
result_chars
number
result_tokens
number
Example generated
{ "tool": "example", "args": {}, "ok": true, "duration_ms": 1, "value": "example", "served_by": "example", "session": "example", "result_chars": 1, "result_tokens": 1}Responses
Section titled “Responses”Done.
Media typeapplication/json
object
ok
boolean
Example
{ "ok": true}Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.
Media typeapplication/json
object
error
required
What went wrong, for a person or an agent.
string
Example generated
{ "error": "example"}Missing or wrong bearer token.
Media typeapplication/json
object
error
required
What went wrong, for a person or an agent.
string
Example generated
{ "error": "example"}Unexpected error.
Media typeapplication/json
object
error
required
What went wrong, for a person or an agent.
string
Example generated
{ "error": "example"}