Skip to main content
Glama

Save completed processing for this email batch

complete_email_batch
Idempotent

Save completed or deferred outcomes for a batch previously returned by claim_email_batch.

    Requires email:read and consumer-state:write. Complete only processed IDs, including silent
    decisions and unrecoverable emails decided from their headers or reported to the owner.
    Defer unfinished IDs or content whose retry_can_help is true; they remain pending with bounded
    retry backoff, and content repaired in the meantime becomes ready at once. Returns
    completed/deferred/remaining IDs, expired_event_ids (removed by retention during the lease;
    accepted, never retried), batch_released and monitor_state. Classifying every
    issued ID releases the batch so other ready work can be claimed. Repeating the same outcomes
    is safe; changing an outcome fails. When only deferred work remains, inspect next_retry_at.
    Changes only this connection's progress: it neither edits emails, sends notifications nor
    cancels another AI's work. Completion does not prove that a notification reached the user.
    

Input Schema

NameRequiredDescriptionDefault
batch_idYesBatch ID returned by claim_email_batch for this connection. A new outcome requires an unexpired lease.
event_idsYesDistinct event_id values issued in this batch that were actually processed, including no-reminder decisions. May be empty if deferring items.
deferred_event_idsNoIssued event_id values not processed yet that should be retried later: unfinished work, or content whose retry_can_help is true. Must be disjoint from event_ids; the two lists together must contain 1 to 50 distinct IDs. Omit when none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / deferred_event_ids / description
      Previous value: -"Issued event_id values that could not be processed. Must be disjoint from event_ids; the two lists together must contain 1 to 50 distinct IDs. Omit when none."New value: +"Issued event_id values not processed yet that should be retried later: unfinished work, or content whose retry_can_help is true. Must be disjoint from event_ids; the two lists together must contain 1 to 50 distinct IDs. Omit when none."
  2. Changed3 schema fields changed
    • addedInput schema / properties / batch_id / description
      Added value: +"Batch ID returned by claim_email_batch for this connection. A new outcome requires an unexpired lease."
    • addedInput schema / properties / deferred_event_ids / description
      Added value: +"Issued event_id values that could not be processed. Must be disjoint from event_ids; the two lists together must contain 1 to 50 distinct IDs. Omit when none."
    • addedInput schema / properties / event_ids / description
      Added value: +"Distinct event_id values issued in this batch that were actually processed, including no-reminder decisions. May be empty if deferring items."
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare idempotentHint=true, destructiveHint=false, readOnlyHint=false, and the description reinforces and extends them: required scopes (email:read, consumer-state:write), retry backoff for deferred items, batch-release semantics, and an explicit negative scope ('neither edits emails, sends notifications nor cancels another AI's work'). It also warns that completion does not prove notification delivery and that expired IDs are accepted but never retried.

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 purpose and the source tool, then prerequisites, then outcome semantics. Dense but every clause carries operational content (scopes, backoff, release, idempotency). Slightly long, with return-value enumeration that could be trimmed given it is not in an output schema, but nothing is wasted.

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?

No output schema exists, yet the description enumerates the return payload (completed/deferred/remaining IDs, expired_event_ids, batch_released, monitor_state) and points to next_retry_at when only deferred work remains. For a mutation tool with prerequisites and failure modes, this is complete enough to invoke correctly.

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 description coverage is 100%, so the baseline is 3; the description goes further by explaining what belongs in each list (processed/silent decisions vs retry_can_help content) and the ready-on-repair behavior. The disjointness and 1-50 cardinality rules are already in the schema, so the added value is real but partly duplicative.

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 ('Save completed or deferred outcomes for a batch') and ties it to the sibling that produces the batch ('previously returned by claim_email_batch'). An agent can distinguish this from claim_email_batch and report_email_decision without opening a 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?

Gives explicit routing rules for both parameter paths: complete only processed IDs (including silent decisions and unrecoverable/header-decided emails), defer unfinished IDs or content whose retry_can_help is true. Adds the operational conditions (unexpired lease, classification of every issued ID releases the batch) and the failure mode of changing an outcome.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.