Skip to main content
Glama
shukiv

blesta-mcp

by shukiv

Create invoice payment link

create_invoice_payment_link
Read-onlyIdempotent

Generate a non-expiring, secure payment link for a specific invoice so the customer can pay without logging in. The link is tied to the owning client and invoice.

Instructions

Produce a customer-facing URL that lets the invoice be paid without logging in. Uses Invoices.createPayHash(client_id, invoice_id) then Encryption.systemEncrypt to build the sid token, exactly like Blesta's own payment reminder emails: {install}/client/pay/method/{invoice_id}/?sid=... . The link is tied to this client and invoice and does not expire. Only hand it to the invoice's own customer. Refuses if the invoice does not belong to client_id. On IonCube-encoded installs this call fails with 'Failed to retrieve the default value' unless BLESTA_SYSTEM_KEY is configured.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idYesNumeric client ID that owns the invoice
invoice_idYesNumeric invoice ID to pay

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already mark this as read-only, idempotent, and non-destructive, and the description adds valuable behavioral details beyond that: the link does not expire, is tied to a specific client and invoice, refuses when ownership mismatches, and can fail on IonCube-encoded installs without BLESTA_SYSTEM_KEY. It also explains the internal token construction, making side effects and dependencies explicit.

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?

The first sentence is front-loaded with the core purpose, and every subsequent sentence conveys behavior or constraints relevant to correct invocation. It is longer than average, but the implementation detail, expiration warning, ownership restriction, and IonCube caveat all earn their place.

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?

With no output schema, the description fully explains what the caller gets: a customer-facing URL with the exact format. It also covers failure conditions, ownership validation, expiration semantics, and environment-specific setup, so an agent has enough context to call this tool correctly.

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?

The schema already documents both parameters with 100% coverage, so the baseline is 3. The description reinforces the ownership relationship between client_id and invoice_id by stating the call refuses mismatches, but it does not add meaningful syntax or format details beyond the schema.

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 states a specific action ('Produce a customer-facing URL') and the exact resource (invoice payment link without login), distinguishing it from sibling tools like verify_invoice_payment_link, which validates rather than generates. It also gives the concrete URL format, leaving no ambiguity about what the tool does.

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?

The description makes the usage context clear: generate a non-expiring, customer-specific payment URL for the invoice's own customer. It includes an important exclusion ('Only hand it to the invoice's own customer') and explains that the call refuses mismatched ownership. It does not explicitly name alternatives, but the purpose is distinct enough to infer when it applies.

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