Skip to main content
Glama

generate_invoice

Generate verifiable client invoices from cryptographically signed AI agent receipts. Aggregate costs, token usage, and actions by date range, grouping line items by agent or activity in JSON, CSV, or Markdown formats.

Instructions

Generate a client invoice from cryptographically signed receipts within a date range. Aggregates receipt data by agent, action, or day and calculates total costs, token usage, and receipt counts. Supports JSON, CSV, and Markdown output formats. Each line item references a signed receipt for verifiable billing. Use to bill clients for AI agent work with cryptographic proof of every billed action.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromYesInvoice period start date in ISO 8601 format (e.g., "2026-01-01" or "2026-01-01T00:00:00Z")
toYesInvoice period end date in ISO 8601 format (e.g., "2026-01-31" or "2026-01-31T23:59:59Z")
client_nameNoClient or bill-to name for the invoice header
client_emailNoClient email address
provider_nameNoYour company or provider name
provider_emailNoYour email address
group_byNoHow to group line items: "action" (by action name), "agent" (by agent ID), "day" (by date), or "none" (single total)
formatNoOutput format: "json" (structured data), "csv" (spreadsheet), or "md" (markdown table)
include_receiptsNoIf true, includes full receipt objects in JSON output for full auditability
agent_idsNoFilter to specific agent IDs only
actionsNoFilter to specific action names only
constraints_passed_onlyNoIf true, only include receipts where all constraints passed
notesNoAdditional notes to include in the invoice
payment_termsNoPayment terms text (e.g., "Net 30", "Due on receipt")
Behavior4/5

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

With no annotations provided, description carries full burden and succeeds well: explains aggregation logic (by agent/action/day), calculations performed (costs, tokens, counts), output format options, and cryptographic verification behavior. Minor gap regarding persistence (file vs. returned data) or side effects.

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

Conciseness5/5

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

Five well-structured sentences that are front-loaded (core action first) and waste-free. Each sentence earns its place: source data, aggregation logic, output formats, audit trail, and use case guidance.

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?

Comprehensive for a 14-parameter tool with complex domain logic (cryptographic billing). Covers aggregation, filtering, and format options implied by the schema. Minor deduction for no output schema requiring some return value description, though input complexity is well-addressed.

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?

With 100% schema coverage, baseline is 3. Description adds valuable semantic context by mapping narrative elements to parameters: 'date range' (from/to), 'agent, action, or day' (group_by enum), and output formats (format enum). Explains domain significance of include_receipts via 'cryptographic proof' context.

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 specific verb (generate), resource (client invoice), and source data (cryptographically signed receipts). Clearly distinguishes from siblings like list_receipts or create_receipt by emphasizing aggregation into a billing document with cryptographic audit trails.

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?

Explicitly states when to use ('Use to bill clients for AI agent work with cryptographic proof'), providing clear context. Lacks explicit 'when not to use' statements or named alternatives (e.g., use list_receipts for simple querying without billing).

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/webaesbyamin/agent-receipts'

If you have feedback or need assistance with the MCP directory API, please join our Discord server