Skip to main content
Glama
jdlar1

Siigo MCP Server

by jdlar1

siigo_create_purchase

Create new purchase records in Siigo accounting software to manage procurement transactions and maintain accurate financial records.

Instructions

Create a new purchase

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
purchaseYesPurchase data

Implementation Reference

  • MCP tool handler for siigo_create_purchase. Extracts purchase data from args and delegates to SiigoClient.createPurchase, then formats and returns the result as text content.
    private async handleCreatePurchase(args: any) {
      const result = await this.siigoClient.createPurchase(args.purchase);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Tool schema definition including name, description, and input schema for creating a purchase.
    {
      name: 'siigo_create_purchase',
      description: 'Create a new purchase',
      inputSchema: {
        type: 'object',
        properties: {
          purchase: { type: 'object', description: 'Purchase data' },
        },
        required: ['purchase'],
      },
    },
  • src/index.ts:120-121 (registration)
    Registration of the tool handler in the switch statement within CallToolRequestSchema handler.
      return await this.handleCreatePurchase(args);
    case 'siigo_update_purchase':
  • SiigoClient method that performs the actual API call to create a purchase by POSTing to /v1/purchases.
    async createPurchase(purchase: any): Promise<SiigoApiResponse<any>> {
      return this.makeRequest<any>('POST', '/v1/purchases', purchase);
    }
  • Core helper method in SiigoClient 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. 'Create a new purchase' implies a write operation, but it does not specify required permissions, whether the action is idempotent, potential side effects (e.g., updating inventory), or error conditions. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

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, clear sentence with no wasted words, making it highly concise and front-loaded. It directly communicates the core action without unnecessary elaboration, which is efficient for an AI agent to parse quickly.

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 creation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., permissions, side effects), usage context, and what the tool returns upon success or failure. Given the complexity implied by nested objects in the schema and the absence of structured safety hints, the description does not provide enough context for reliable agent invocation.

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 one parameter 'purchase' described as 'Purchase data'. The description does not add any meaning beyond this, as it only repeats the tool's purpose without detailing what 'purchase' should include (e.g., fields, structure, or examples). Given the high schema coverage, a 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 'Create a new purchase' clearly states the verb ('Create') and resource ('purchase'), making the purpose immediately understandable. It distinguishes from sibling tools like 'siigo_get_purchase' or 'siigo_update_purchase' by specifying creation rather than retrieval or modification. However, it lacks specificity about what a 'purchase' entails in this context (e.g., a transaction, order, or record).

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 on when to use this tool versus alternatives. The description does not mention prerequisites, such as needing existing customer or product data, or when to choose this over similar tools like 'siigo_create_invoice' or 'siigo_create_voucher'. Without this context, the agent must infer usage from tool names alone.

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