Skip to main content
Glama
io.github.JC7333/mandatia

io.github.JC7333/mandatia

by JC7333

log_action

Records an AI agent's actions under an active mandate in a tamper-evident, SHA-256-linked audit trail for compliance and oversight.

Instructions

Log an action performed by an AI agent under an active mandate for audit and compliance.

Each action log entry is cryptographically linked to the previous action (SHA-256 chain), creating a tamper-evident audit trail. The mandate must be active, not revoked and not expired; for a sub-mandate, so must every mandate above it in the delegation chain (revoking or letting expire a parent stops the logging of its whole branch).

Args: mandate_id: UUID of the mandate under which the action was performed. Example: "550e8400-e29b-41d4-a716-446655440000" action: Description of the action that was performed. Example: "Generated investment recommendation for Product X" evidence: Optional supporting evidence or reference for the action. Example: "email:msg_abc123" or "document:report_2026_042.pdf" result: Optional outcome or result of the action. Example: "Delivered" or "Rejected by client" or "Pending review"

Returns: JSON string with keys: status, action_id, mandate_id, action, chain_hash. On error (invalid mandate): {"error": "..."}; when a mandate above a sub-mandate breaks the chain, also "reason" (parent_mandate_revoked, parent_mandate_expired, parent_mandate_, parent_mandate_not_found or delegation_chain_too_deep) and "refused_by" (the mandate that broke it, or null).

Input Schema

NameRequiredDescriptionDefault
actionYes
resultNo
evidenceNo
mandate_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it discloses that entries are chained via SHA-256 into a tamper-evident trail, that delegation-chain status is enforced, and it enumerates error reasons including parent_mandate_revoked and delegation_chain_too_deep. It stops short of stating idempotency, append-only/immutability guarantees for existing entries, or any rate/throughput limits.

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

Conciseness4/5

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

Front-loaded with the core purpose, then structured Args/Returns sections, making it easy to scan. It is somewhat verbose — the parent-mandate explanation is restated in both prose and the Returns section — but each block carries distinct information rather than filler.

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

Completeness5/5

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

An output schema exists, yet the description still adds value by naming the returned keys and, more importantly, documenting error shapes ('reason', 'refused_by') that a schema would not enumerate as enumerations. For a security-sensitive, mutation-style audit tool, this covers what an agent needs to call it correctly and interpret failures.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does: every one of the four parameters is described with its purpose, optionality ('Optional supporting evidence'), and a concrete example value. Evidence format hints ('email:msg_abc123', 'document:report_2026_042.pdf') add meaning the bare string-typed schema cannot convey.

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 opening sentence pairs a specific verb ('Log') with a specific resource ('an action performed by an AI agent under an active mandate') and states the domain (audit and compliance). It is immediately distinguishable from siblings like verify_mandate or issue_action_token, which do not create audit entries.

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?

The description gives clear preconditions for use: the mandate must be active, not revoked, and not expired, and for sub-mandates every ancestor mandate must satisfy the same. It does not explicitly route to alternatives (e.g., when to contest_action instead, or when an action token is required first), so it stops short of full when/when-not guidance.

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