Skip to content

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/
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 }'
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"}
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
}

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"
}