Skip to main content
Glama
jdlar1

Siigo MCP Server

by jdlar1

siigo_create_invoice

Generate invoices in Siigo accounting software by providing customer details, items, payments, and required documentation.

Instructions

Create a new invoice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesInvoice data

Implementation Reference

  • Core handler implementation for creating an invoice via POST to Siigo API /v1/invoices endpoint.
    async createInvoice(invoice: SiigoInvoice): Promise<SiigoApiResponse<SiigoInvoice>> {
      return this.makeRequest<SiigoInvoice>('POST', '/v1/invoices', invoice);
    }
  • MCP server handler that receives tool call params and delegates to SiigoClient.createInvoice, formats response.
    private async handleCreateInvoice(args: any) {
      const result = await this.siigoClient.createInvoice(args.invoice);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
  • src/index.ts:374-396 (registration)
    Tool registration in MCP server's getTools() method, including name, description, and detailed input schema.
    {
      name: 'siigo_create_invoice',
      description: 'Create a new invoice',
      inputSchema: {
        type: 'object',
        properties: {
          invoice: {
            type: 'object',
            description: 'Invoice data',
            properties: {
              document: { type: 'object', properties: { id: { type: 'number' } }, required: ['id'] },
              date: { type: 'string', description: 'Invoice date (YYYY-MM-DD)' },
              customer: { type: 'object', description: 'Customer information' },
              seller: { type: 'number', description: 'Seller ID' },
              items: { type: 'array', items: { type: 'object' }, description: 'Invoice items' },
              payments: { type: 'array', items: { type: 'object' }, description: 'Payment methods' },
            },
            required: ['document', 'date', 'customer', 'seller', 'items', 'payments'],
          },
        },
        required: ['invoice'],
      },
    },
  • TypeScript interface defining the structure of SiigoInvoice used for input validation and API calls.
    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;
    }
  • Helper method for making authenticated HTTP requests to Siigo API, used by createInvoice and all other endpoints.
    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?

With no annotations provided, the description carries full burden for behavioral disclosure. 'Create a new invoice' implies a write operation but doesn't specify permissions needed, whether it's idempotent, error handling, or what happens on success/failure. For a mutation tool with complex nested parameters, this is inadequate.

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 extremely concise at just three words with no wasted language. It's front-loaded with the core purpose, though this brevity comes at the cost of completeness for such a complex tool.

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?

For a complex invoice creation tool with nested objects, no annotations, and no output schema, the description is insufficient. It doesn't explain what constitutes valid invoice data, expected responses, error conditions, or how this tool fits within the broader SiiGo accounting system context.

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%, providing good documentation for all parameters. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline for high schema coverage but doesn't enhance understanding of the complex nested structure.

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

Purpose3/5

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

The description 'Create a new invoice' clearly states the action (create) and resource (invoice), but it's vague about what constitutes an invoice in this system and doesn't differentiate from sibling tools like siigo_create_credit_note or siigo_create_payment_receipt. It's functional but lacks specificity about the domain context.

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?

No guidance is provided about when to use this tool versus alternatives like siigo_update_invoice or siigo_create_credit_note. The description doesn't mention prerequisites, constraints, or typical use cases, leaving the agent with no context for tool selection.

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