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

io.github.JC7333/mandatia

by JC7333

prepare_mandate_signature

Generate the exact payload bytes a principal must sign to authorize a mandate without writing it; use the returned signed_at and principal signature when calling create_mandate.

Instructions

Return the exact bytes a principal must sign to grant this mandate.

Takes the same arguments as create_mandate. Nothing is written. The principal signs payload (UTF-8 bytes; payload_b64url is the same bytes) with its Ed25519 key, then calls create_mandate with the same arguments plus principal_signature and this signed_at. Any difference in the arguments makes the signature invalid.

Args: signed_at: ISO 8601 timestamp with timezone to place in the payload. Default: now (UTC). Example: "2026-10-18T20:30:00+00:00" (all other arguments: see create_mandate)

Returns: JSON string with keys: payload (str), payload_b64url, signed_at. On error: {"error": "...", "code": "..."}.

Input Schema

NameRequiredDescriptionDefault
scopeYes
agent_idYes
currencyNoEUR
metadataNo
signed_atNo
max_amountNo
period_daysNo
principal_idYes
risk_classesNo
amount_actionsNo
duration_hoursYes
allowed_actionsNo
forbidden_actionsNo
parent_mandate_idNo
period_max_amountNo
delegation_allowedNo
legal_basis_articleYes
max_delegation_depthNo
legal_basis_regulationYes
legal_basis_jurisdictionNoEU

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.1/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 burden and does well: it declares 'Nothing is written' (critical for a name that sounds like a mutation), states the strict invariant that any argument difference invalidates the signature, and documents the error shape. It omits prerequisites such as whether the principal key must first be registered via register_principal_key.

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 in the first sentence, then workflow, then Args/Returns blocks. Efficient for a complex tool, with only minor redundancy in the parenthetical '(UTF-8 bytes; payload_b64url is the same bytes)'.

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?

An output schema exists, yet the description still summarizes return keys and the error object, which is helpful but not required. For a 20-parameter cryptographic preparation tool the essential contract (identical-arguments invariant, signed_at format, no side effects) is covered; the main gap is the undisclosed precondition that the principal's signing key must already be registered.

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 0% across 20 parameters, so the description must compensate. It documents signed_at thoroughly (ISO 8601 with timezone, default now UTC, worked example) and adds the crucial semantic that all arguments are signature-bound, but it punts the remaining ~19 parameters to 'see create_mandate', leaving their meaning outside this definition.

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: 'Return the exact bytes a principal must sign to grant this mandate.' The second sentence ('Takes the same arguments as create_mandate. Nothing is written.') immediately distinguishes it from the sibling create_mandate, which an agent might otherwise confuse it with.

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?

Gives a clear operating context: call this, have the principal sign payload with its Ed25519 key, then call create_mandate with identical arguments plus principal_signature and this signed_at. It does not name the other preparation siblings (prepare_mandate_pdf, prepare_revocation_signature, prepare_contest_signature) or state exclusions, so it stops short of explicit when-not guidance.

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