Skip to main content
Glama

sign_invoice

Apply XAdES-BES digital signature to an unsigned ZATCA invoice XML using PEM certificate and private key, generating signed XML, invoice hash, QR code, and compliance status.

Instructions

Digitally sign a ZATCA invoice with XAdES-BES.

Takes an unsigned invoice XML and applies a digital signature using the provided certificate and private key. Produces a signed XML with embedded XAdES-BES signature in UBLExtensions, and rebuilds the QR code with Phase 2 tags (hash, signature, public key).

Args: invoice_xml: Unsigned UBL 2.1 XML invoice string certificate_pem: PEM-encoded X.509 certificate from ZATCA private_key_pem: PEM-encoded ECDSA private key

Returns: JSON with signed_xml, invoice_hash, qr_base64, and compliance status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoice_xmlYes
certificate_pemYes
private_key_pemYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description fully describes the signing process, input/output, and QR code rebuilding; lacks details on error states or prerequisites.

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?

Concise headline, clear description, and structured argument/return sections; no wasted words.

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?

Complex tool with output schema; description covers input, process, and output fields (signed_xml, invoice_hash, qr_base64, compliance status) adequately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description adds detailed explanations for all three parameters (invoice XML, certificate, private key) beyond their names.

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?

The description clearly states the tool signs a ZATCA invoice with XAdES-BES and explains the process, distinguishing it from siblings like generate_invoice and validate_invoice.

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 (to sign an invoice) and the context of ZATCA invoices; while it doesn't specify when not to use, the sibling tool list provides implicit differentiation.

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/DoubleH10/zatca-mcp'

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