get_payment_types
Retrieve all configured payment methods like cash, credit card, or bank transfer to use their IDs when creating invoices or cash receipts in Siigo.
Instructions
Get all configured payment types/methods.
Returns a list of payment types (cash, credit card, bank transfer, etc.) Use these payment type IDs when creating invoices or cash receipts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/siigo_mcp/tools/reference.py:20-27 (handler)The core handler function for the 'get_payment_types' tool. Decorated with @mcp.tool for MCP registration. Fetches payment types from the Siigo API endpoint '/payment-types' using the get_client utility.@mcp.tool async def get_payment_types(ctx: Context) -> list[dict[str, Any]]: """Get all configured payment types/methods. Returns a list of payment types (cash, credit card, bank transfer, etc.) Use these payment type IDs when creating invoices or cash receipts. """ return await get_client(ctx).get("/payment-types")
- src/siigo_mcp/server.py:110-110 (registration)Import statement in the main server.py that loads the reference.py module, registering the get_payment_types tool via its @mcp.tool decorator (in non-lazy mode).from siigo_mcp.tools import reference # noqa: E402, F401
- src/siigo_mcp/tools/discovery.py:74-74 (registration)In lazy-tools mode, maps the tool name to its function reference for dynamic loading and execution."get_payment_types": reference.get_payment_types,
- src/siigo_mcp/tools/discovery.py:20-20 (registration)TOOL_INDEX entry that lists the tool for discovery via list_siigo_tools().{"name": "get_payment_types", "category": "reference", "summary": "Get all payment types/methods"},
- src/siigo_mcp/server.py:85-102 (helper)Utility function used by the handler to obtain a SiigoClient instance for making the API request.def get_client(ctx: Context) -> SiigoClient: """Get Siigo client - from headers (HTTP mode) or env vars (stdio mode).""" if _transport == "http": if not ctx.request_context: raise ValueError("No request context available in HTTP mode") headers = ctx.request_context.request.headers username = headers.get("x-siigo-username") access_key = headers.get("x-siigo-access-key") partner_id = headers.get("x-siigo-partner-id") if not all([username, access_key, partner_id]): raise ValueError( "Missing required headers: x-siigo-username, x-siigo-access-key, x-siigo-partner-id" ) client_class = _get_client_class() return client_class(username=username, access_key=access_key, partner_id=partner_id) return _get_global_client()