Skip to main content
Glama

save_event

Record agent actions, decisions, and state changes in an append-only event log to enable deterministic replay and maintain an immutable audit trail.

Instructions

Append an event to the shared event log with optional metadata.

Use this to record agent actions, decisions, and state changes. All events are append-only with stable UUIDv7 ordering, enabling deterministic replay.

Side effects: Creates a new event in the SQLite event log. Triggers an automatic snapshot when the event threshold is reached. This is the primary write operation for the event-sourced architecture.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesEvent type identifier (e.g., "TASK_CREATED", "TASK_ASSIGNED", "TOOL_CALLED", "DECISION_MADE").
branchNoOptional branch name (for git-based project tracking).
sourceNoEvent source label (default "agent"). Use "allbrain" for system-generated events, or the agent name for agent actions.agent
payloadYesEvent data as a JSON-serializable dict. Should contain the relevant state or information being recorded.
caused_byNoOptional causal event reference (creates event provenance).
file_pathNoOptional source file path (for code-related events).
task_hintNoOptional task hint string (helps with memory building).
importanceNoOptional importance rating (1-5); higher values may trigger more frequent snapshots.
session_idNoOptional session ID to associate with (for multi-agent tracing).
impact_scoreNoOptional impact score for decision events.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses side effects: creates event in SQLite, triggers automatic snapshot on threshold. Annotations are absent, so description carries full burden and meets it well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise with four front-loaded sentences. No fluff, every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 10 parameters and output schema, description covers purpose, usage, and side effects. Could mention event type conventions or error handling, but still adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. Description adds no parameter-specific info beyond schema, but overall context is present.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Append an event to the shared event log' with specific verb and resource. It distinguishes from sibling 'list_events' and calls it the primary write operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Guidance is given: 'Use this to record agent actions, decisions, and state changes.' However, it does not explicitly exclude use cases or compare with alternatives like 'build_memory'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mustafa-Ali-Ertugrul/allbrain-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server