Skip to main content
Glama
jdlar1

Siigo MCP Server

by jdlar1

siigo_create_voucher

Create accounting vouchers in Siigo software to document financial transactions and maintain accurate records.

Instructions

Create a new voucher

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
voucherYesVoucher data

Implementation Reference

  • Core handler implementation for siigo_create_voucher tool. Performs authenticated POST request to Siigo API /v1/vouchers endpoint with provided voucher data.
    async createVoucher(voucher: any): Promise<SiigoApiResponse<any>> {
      return this.makeRequest<any>('POST', '/v1/vouchers', voucher);
    }
  • MCP server handler that receives tool call, extracts voucher args, delegates to SiigoClient.createVoucher, and returns formatted JSON response.
    private async handleCreateVoucher(args: any) {
      const result = await this.siigoClient.createVoucher(args.voucher);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Defines the input schema and metadata for the siigo_create_voucher tool, used in listTools response for client validation.
    {
      name: 'siigo_create_voucher',
      description: 'Create a new voucher',
      inputSchema: {
        type: 'object',
        properties: {
          voucher: { type: 'object', description: 'Voucher data' },
        },
        required: ['voucher'],
      },
    },
  • src/index.ts:111-112 (registration)
    Registers the dispatch case in the switch statement for handling siigo_create_voucher tool calls within the CallToolRequestSchema handler.
    case 'siigo_create_voucher':
      return await this.handleCreateVoucher(args);
  • Helper method used by createVoucher to handle authentication, HTTP requests to Siigo API, and error handling.
    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}`);
      }
    }

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