Skip to main content
Glama
jdlar1

Siigo MCP Server

by jdlar1

siigo_update_invoice

Modify existing invoice records in Siigo accounting software by providing the invoice ID and updated data to correct errors or reflect changes.

Instructions

Update an existing invoice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesInvoice ID
invoiceYesInvoice data to update

Implementation Reference

  • MCP tool handler that invokes SiigoClient.updateInvoice with args.id and args.invoice, formats the result as JSON text content.
    private async handleUpdateInvoice(args: any) {
      const result = await this.siigoClient.updateInvoice(args.id, args.invoice);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Core implementation that performs a PUT request to Siigo API endpoint /v1/invoices/{id} to update the invoice.
    async updateInvoice(id: string, invoice: Partial<SiigoInvoice>): Promise<SiigoApiResponse<SiigoInvoice>> {
      return this.makeRequest<SiigoInvoice>('PUT', `/v1/invoices/${id}`, invoice);
    }
  • src/index.ts:397-408 (registration)
    Tool registration in getTools() array, including name, description, and input schema.
    {
      name: 'siigo_update_invoice',
      description: 'Update an existing invoice',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'Invoice ID' },
          invoice: { type: 'object', description: 'Invoice data to update' },
        },
        required: ['id', 'invoice'],
      },
    },
  • Type definition for SiigoInvoice used in updateInvoice parameters.
    export interface SiigoInvoice {
      id?: string;
      document: {
        id: number;
        number?: number;
      };
      date: string;
      customer: {
        person_type?: string;
        id_type?: string;
        identification: string;
        branch_office?: number;
        name?: string[];
        address?: any;
        phones?: any[];
        contacts?: any[];
      };
      cost_center?: number;
      currency?: {
        code: string;
        exchange_rate: number;
      };
      seller: number;
      observations?: string;
      items: Array<{
        code: string;
        description?: string;
        quantity: number;
        price: number;
        discount?: number;
        taxes?: Array<{ id: number }>;
      }>;
      payments: Array<{
        id: number;
        value: number;
        due_date?: string;
      }>;
      stamp?: {
        send: boolean;
      };
      mail?: {
        send: boolean;
      };
      global_discounts?: Array<{
        id: number;
        percentage?: number;
        value?: number;
      }>;
      additional_fields?: any;
    }
  • Shared helper method that handles authentication, makes HTTP requests to Siigo API, and processes responses/errors.
    private async makeRequest<T>(method: string, endpoint: string, data?: any, params?: any): Promise<SiigoApiResponse<T>> {
      await this.authenticate();
    
      try {
        const response: AxiosResponse<SiigoApiResponse<T>> = await this.httpClient.request({
          method,
          url: endpoint,
          data,
          params,
        });
    
        return response.data;
      } catch (error: any) {
        if (error.response?.data) {
          return error.response.data;
        }
        throw new Error(`API request failed: ${error.message}`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool updates an invoice, implying a mutation, but fails to describe critical behaviors such as required permissions, whether updates are partial or full, validation rules, error handling, or side effects. This leaves significant gaps for an agent to understand how to use it safely and effectively.

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?

The description is a single, efficient sentence with no wasted words. It is front-loaded with the core action and resource, making it easy to parse. Every word contributes directly to stating the tool's purpose without redundancy or fluff.

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

Completeness2/5

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

Given the complexity of updating an invoice (a mutation operation with nested objects) and the absence of annotations and output schema, the description is insufficient. It lacks details on behavioral traits, error conditions, response format, and how it integrates with sibling tools. For a tool with potential side effects and no structured safety hints, more context is needed to ensure reliable agent use.

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 input schema has 100% description coverage, with clear documentation for both parameters ('id' and 'invoice'). The description does not add any semantic details beyond what the schema provides, such as examples of invoice data or format constraints. With high schema coverage, the baseline score of 3 is appropriate, as the schema handles parameter documentation adequately.

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 clearly states the action ('Update') and the resource ('an existing invoice'), providing a specific verb+resource combination. It distinguishes itself from sibling tools like siigo_create_invoice (creation) and siigo_delete_invoice (deletion), but does not specify what aspects of the invoice can be updated or how it differs from other update tools like siigo_update_customer.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing an existing invoice ID), exclusions, or comparisons to other update tools (e.g., siigo_update_payment_receipt). Usage is implied by the name and context, but no explicit instructions are given.

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/jdlar1/siigo-mcp'

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