Skip to main content
Glama

Aggregate Settlement Record

aps_aggregate_settlement
Read-onlyIdempotent

Aggregate attribution primitives over a half-open settlement period into a signed SettlementRecord with per-contributor totals, Merkle commitments, and residual buckets for verification.

Instructions

Aggregate a batch of Attribution Primitives over a half-open settlement period [t0, t1) into a signed SettlementRecord. Each axis (D, P, G, C) produces a per-contributor total with a balanced-Merkle commitment. Residual buckets pool sub-threshold contributors. Output is a fully signed record ready for third-party verification.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYes
receiptsYesArray of AttributionPrimitives to aggregate
issued_atNoOverride issued_at (canonical ISO-8601 UTC ms + Z); defaults to now
gateway_didYesGateway DID that signs the record
gateway_private_keyYesEd25519 gateway private key (hex)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv4.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / period / additionalProperties
      Removed value: -false
    • addedInput schema / properties / receipts / items
      Added value: +{}
  2. Addedv2.8.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower, and the description adds genuine behavioral context beyond them: per-axis (D, P, G, C) contributor totals, balanced-Merkle commitments, and residual buckets pooling sub-threshold contributors. It does not disclose whether anything is persisted server-side or the key-handling/auth implications of passing gateway_private_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?

Three sentences, front-loaded with the core verb+resource and scope, then mechanics, then output nature. No filler. Slightly dense with undefined domain jargon (D/P/G/C, 'balanced-Merkle'), but every sentence contributes.

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 cryptographic aggregation tool with nested objects, no output schema, and four required parameters, the description adequately characterizes the produced artifact (fully signed, third-party verifiable) and the internal structure of the result. It omits error/edge behavior (empty receipt sets, sub-threshold threshold definition) and whether the signing key implies any side effect.

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 80%, so the schema already documents period bounds, receipts, gateway_did, and the private key. The description clarifies the period's half-open semantics but adds no syntax or format detail for receipts, and the axis names (D, P, G, C) are not tied back to any parameter. Baseline 3 is appropriate when the schema carries the load.

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 ('Aggregate a batch of Attribution Primitives ... into a signed SettlementRecord') plus the operating scope (half-open period [t0, t1)). This clearly differentiates it from siblings like aps_verify_settlement, aps_project_attribution, and generate_settlement without needing to open any schema.

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

Usage Guidelines3/5

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

Usage is only implied: the aggregation-over-a-period framing implies it runs after primitives exist and before verification, but the description never states when to use this tool versus aps_verify_settlement or generate_settlement, nor any prerequisite/exclusion conditions. No explicit routing guidance.

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

Deploy Server

Other Tools