Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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")
  • 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
  • In lazy-tools mode, maps the tool name to its function reference for dynamic loading and execution.
    "get_payment_types": reference.get_payment_types,
  • 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"},
  • 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()

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/dsfaccini/siigo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server