Skip to main content
Glama

Publish a draft election

publish_election
Destructive

Publish a DRAFT election in the connected account, running every check the publish button runs (ballot, schedule, voter list, state law, price) and charging the price from the account's prepaid balance or plan. Free elections (up to 25 voters) publish at no cost. If the balance does not cover it, nothing is charged and the person pays by card, at the finish link or on a payment page from create_checkout_link. Publishing follows a card payment either way: the page the person returns to from Stripe publishes once the payment lands, or call this with after_payment: true, which waits for the payment and publishes without a second charge, never drawing on the balance as well. An election that is already published and paid for answers status already_published with its links, not a refusal. Once published it emails voters their ballots when it can send as the organizer; through an assistant connection it usually cannot, so the result says whether ballots were emailed and, if not, links the election page where the organizer sends them. Confirm with the person before calling this; it can spend their money.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "election": "<election>"
    },
    "name": "publish_election"
  }
}

Input Schema

NameRequiredDescriptionDefault
electionYesThe election's id or slug, from list_elections or create_election_draft.
after_paymentNotrue once the person has paid by card (on a create_checkout_link page or at the finish link): waits up to 15 seconds for the payment to reach vote.direct, then publishes without charging anything, or answers already_published if the page they returned to has published it. Leave it out otherwise.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / after_payment
      Added value: +{
      +  "description": "true once the person has paid by card (on a create_checkout_link page or at the finish link): waits up to 15 seconds for the payment to reach vote.direct, then publishes without charging anything, or answers already_published if the page they returned to has published it. Leave it out otherwise.",
      +  "type": "boolean"
      +}
  2. Added

TDQS

A4/5.0
Behavior4/5

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

Rich disclosure beyond the annotations: it charges the prepaid balance or plan, publishes free elections under 25 voters at no cost, charges nothing when the balance is short, and never double-charges with after_payment. One mild tension: annotations set idempotentHint=false while the description says a re-run on an already-paid election returns 'already_published' rather than refusing, which reads closer to idempotent behavior.

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

Conciseness3/5

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

The core action is front-loaded, which is good, but the rest is a dense wall of prose covering payment fallbacks, idempotent re-runs, and voter-email behavior. Each sentence carries information, yet it would be far more scannable as structured clauses or bullets rather than one paragraph.

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?

There is no output schema, and the description compensates well by describing return states in prose (already_published with links, whether ballots were emailed, the election page link). For a money-spending mutation this is nearly complete; only edge cases like the 15-second payment wait boundary are left partly to the parameter schema.

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 100%, so the schema already documents both 'election' and 'after_payment' in detail, and the description largely restates the after_payment semantics (waits for payment, no second charge). The added value ('never drawing on the balance as well') is marginal, so the baseline of 3 is appropriate.

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 ('Publish a DRAFT election in the connected account') and immediately frames the scope of what that entails (runs every publish-button check). It implicitly routes away from sibling draft tools (create_election_draft, update_election_draft) and toward create_checkout_link for the payment path, so an agent can place it correctly.

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 clear context for when to invoke it (after a card payment, or with after_payment: true) and an explicit precondition ('Confirm with the person before calling this; it can spend their money'). It does not spell out an exhaustive when-not list or name alternatives like get_election_readiness as an alternative pre-check, so it falls short of 5.

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.

Resources