Skip to main content
Glama

Convert Document

convert_document

Convert document details to an invoice, estimate, receipt, credit note, or refund PDF. HTTP calls can return a temporary download link.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "document": {
        "to": {
          "name": "Client"
        },
        "from": {
          "name": "Acme"
        },
        "doc_type": "estimate"
      },
      "target_type": "invoice"
    },
    "name": "convert_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
documentYesStateless input document JSON payload to transform.
due_daysNoDays until payment due.
target_typeYesTarget type (invoice, receipt, estimate, credit_note, refund).
payment_linkNoHTTPS link supplied by the user to include in the document.
credit_reasonNoCredit note or refund reason.
payment_qr_codeNoEmbed SVG vector QR code.

Output Schema

NameRequiredDescriptionDefault
documentYesConverted document JSON.
downloadNoTemporary file link for HTTP tool calls.
pdf_base64YesBase64 vector PDF.
download_errorNoWhy a temporary download link could not be created. The embedded PDF is still available.
compile_time_msYesCompile time in ms.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / payment_link / description
      Previous value: -"HTTPS checkout URL for QR code."New value: +"HTTPS link supplied by the user to include in the document."
  2. Changed2 schema fields changed
    • addedOutput schema / properties / download
      Added value: +{
      +  "description": "Temporary file link for HTTP tool calls.",
      +  "properties": {
      +    "expires_at": {
      +      "format": "date-time",
      +      "type": "string"
      +    },
      +    "expires_in_seconds": {
      +      "type": "integer"
      +    },
      +    "filename": {
      +      "type": "string"
      +    },
      +    "url": {
      +      "format": "uri",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "url",
      +    "filename",
      +    "expires_at",
      +    "expires_in_seconds"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / download_error
      Added value: +{
      +  "description": "Why a temporary download link could not be created. The embedded PDF is still available.",
      +  "type": "string"
      +}
  3. Changed10 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "document": {
      +      "doc_type": "estimate",
      +      "from": {
      +        "name": "Acme"
      +      },
      +      "to": {
      +        "name": "Client"
      +      }
      +    },
      +    "target_type": "invoice"
      +  }
      +]
    • changedInput schema / properties / credit_reason / description
      Previous value: -"Reason for issuing credit note or refund (e.g. Overbilling, Cancellation)."New value: +"Credit note or refund reason."
    • changedInput schema / properties / document / description
      Previous value: -"Stateless input document JSON payload to transform (returns a new synthesized document without mutating server records)."New value: +"Stateless input document JSON payload to transform."
    • changedInput schema / properties / due_days / description
      Previous value: -"Number of days until payment is due (for invoice conversion)."New value: +"Days until payment due."
    • changedInput schema / properties / payment_link / description
      Previous value: -"Optional checkout URL to embed as a vector QR code and clickable link."New value: +"HTTPS checkout URL for QR code."
    • changedInput schema / properties / payment_qr_code / description
      Previous value: -"Whether to render an SVG vector QR code for 1-scan mobile payment."New value: +"Embed SVG vector QR code."
    • changedInput schema / properties / target_type / description
      Previous value: -"Target lifecycle document type (invoice, receipt, estimate, credit_note, refund)."New value: +"Target type (invoice, receipt, estimate, credit_note, refund)."
    • changedOutput schema / properties / compile_time_ms / description
      Previous value: -"Vector compilation latency in milliseconds."New value: +"Compile time in ms."
    • changedOutput schema / properties / document / description
      Previous value: -"Newly synthesized converted document JSON."New value: +"Converted document JSON."
    • changedOutput schema / properties / pdf_base64 / description
      Previous value: -"Base64-encoded vector PDF of the converted document."New value: +"Base64 vector PDF."
  4. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, and destructiveHint=false, so the mutation profile is covered. The description adds real value by disclosing that HTTP calls can return a temporary download link, but it does not clarify whether a persistent document record is created or what repeated non-idempotent calls do.

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?

Two tight sentences with the core action front-loaded and no wasted wording. The phrase 'document details' is slightly vague, but the sentence is otherwise efficient and purposeful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and annotations carry the safety profile. However, for a non-idempotent, non-read-only conversion tool with a nested object payload, the description leaves open whether the conversion persists a record or is purely stateless rendering, which is the main thing an agent would want to know.

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 all six parameters are already documented in the schema, which sets the baseline at 3. The description restates the target types (matching the enum) and PDF output but adds no semantics about due_days, payment_link, credit_reason, or payment_qr_code beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource ('Convert document details to an invoice, estimate, receipt, credit note, or refund PDF') and names the output format, so the agent knows exactly what is produced. It does not explicitly distinguish itself from siblings like generate_document or preview_document, leaving that separation to inference.

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 agent can infer this is for turning an existing document payload into a different document type rendered as PDF. There is no explicit when-to-use, when-not-to-use, or named alternative such as generate_document or preview_document.

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.