Skip to main content
Glama

siigo_get_purchase

Retrieve a specific purchase record from Siigo accounting software using its unique ID to access transaction details and documentation.

Instructions

Get a specific purchase by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesPurchase ID

Implementation Reference

  • src/index.ts:527-537 (registration)
    Tool registration in getTools() array, including name, description, and input schema definition.
    { name: 'siigo_get_purchase', description: 'Get a specific purchase by ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Purchase ID' }, }, required: ['id'], }, },
  • MCP server handler method for 'siigo_get_purchase' tool, delegates to SiigoClient.getPurchase and formats response.
    private async handleGetPurchase(args: any) { const result = await this.siigoClient.getPurchase(args.id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • SiigoClient.getPurchase method: the core implementation that makes the authenticated GET request to Siigo API /v1/purchases/{id}.
    async getPurchase(id: string): Promise<SiigoApiResponse<any>> { return this.makeRequest<any>('GET', `/v1/purchases/${id}`); }
  • makeRequest helper: handles authentication, makes Axios request 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}`); } }
  • src/index.ts:117-118 (registration)
    Switch case registration/dispatch for the tool name to handler in CallToolRequestSchema handler.
    case 'siigo_get_purchase': return await this.handleGetPurchase(args);

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