Skip to main content
Glama

capture_event

Records AI coding agent lifecycle events via hook scripts, returning context packs, reindexing files, and consolidating memory to maintain codebase cognition.

Instructions

Capture a lifecycle event — called by hook scripts, not intended for direct use. session_start/prompt_submit return context packs; file_save reindexes and may return rules governing the edited file; session_end runs consolidation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesAbsolute path to the project root containing `.cogz/`.
promptNoPrompt text (for prompt_submit).
file_pathNoSaved file path, relative to repo root (for file_save).
tool_nameNoTool name (for pre_tool_use, post_tool_use).
event_typeYesEvent type: session_start, prompt_submit, pre_tool_use, post_tool_use, file_save, session_end.
tool_resultNoTool result summary (for post_tool_use).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.6

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does disclose side effects and return behavior: 'session_start/prompt_submit return context packs', 'file_save reindexes and may return rules', 'session_end runs consolidation'. It omits any behavior for pre_tool_use/post_tool_use, leaving those two event types opaque.

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?

Two dense sentences with the caller/scope constraint front-loaded and zero filler; every clause conveys distinct information about invocation or per-event behavior.

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?

For a 6-parameter tool with no annotations and no output schema, the description usefully explains the return behavior of most events, but two of the six event types (pre_tool_use, post_tool_use) get no behavioral treatment, leaving a gap an agent cannot close from structured fields.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema by mapping event_type values to distinct behaviors (context packs, reindexing, consolidation) that the raw enum listing does not convey. The other five parameters are covered by their own schema descriptions.

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?

States a specific verb and resource ('Capture a lifecycle event') and immediately scopes who invokes it ('called by hook scripts, not intended for direct use'). An agent can distinguish this event-ingest tool from sibling query/entity tools without opening the schema.

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

Usage Guidelines5/5

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

Provides an explicit when-not ('not intended for direct use') and identifies the actual caller (hook scripts), which is exactly the routing information an agent needs to avoid invoking it manually. Context for each event type is also implied.

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