{
    "schema_version": "v1",
    "protocol": "mcp",
    "protocol_version": "2024-11-05",
    "name": "Contractor Hub",
    "version": "1.0.0",
    "description": "Business management platform for South African contractors — jobs, invoices, clients, bookings, payroll, and SOS dispatch.",
    "homepage": "https://www.nextechdisplay.com/",
    "docs": "https://www.nextechdisplay.com/llms.txt",
    "server": {
        "url": "https://www.nextechdisplay.com/finance/api/mcp.php",
        "transport": "http",
        "methods": [
            "POST"
        ],
        "content_type": "application/json"
    },
    "authentication": {
        "type": "bearer",
        "description": "Bearer token required. Call get_api_key while authenticated, or find your key in Settings → API Access.",
        "obtain_url": "https://www.nextechdisplay.com/finance"
    },
    "capabilities": {
        "tools": {
            "listChanged": false
        },
        "resources": false,
        "prompts": false,
        "logging": false
    },
    "tools": [
        {
            "name": "get_business_overview",
            "description": "Returns a summary of the business: revenue this month, total jobs, pending invoice count and amount, open jobs, and total client count.",
            "inputSchema": {
                "type": "object",
                "properties": {},
                "required": []
            }
        },
        {
            "name": "list_recent_jobs",
            "description": "Lists the most recent jobs with their status, client name, amount, and scheduled date.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "limit": {
                        "type": "integer",
                        "description": "Max jobs to return (default 10)",
                        "default": 10
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "in_progress",
                            "completed",
                            "invoiced",
                            "cancelled"
                        ]
                    }
                },
                "required": []
            }
        },
        {
            "name": "list_clients",
            "description": "Lists clients with contact details and lifetime value.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "limit": {
                        "type": "integer",
                        "default": 20
                    },
                    "search": {
                        "type": "string",
                        "description": "Search by name, email or phone"
                    }
                },
                "required": []
            }
        },
        {
            "name": "list_pending_invoices",
            "description": "Lists all unpaid invoices (draft, sent, overdue) with amounts and due dates.",
            "inputSchema": {
                "type": "object",
                "properties": {},
                "required": []
            }
        },
        {
            "name": "list_upcoming_bookings",
            "description": "Lists upcoming bookings and appointments within the next N days.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "days": {
                        "type": "integer",
                        "description": "Days ahead to look (default 30)",
                        "default": 30
                    }
                },
                "required": []
            }
        },
        {
            "name": "get_api_key",
            "description": "Returns or generates the authenticated user's MCP Bearer API key. Requires an active browser session.",
            "inputSchema": {
                "type": "object",
                "properties": {},
                "required": []
            }
        },
        {
            "name": "register_user",
            "description": "Register a new Contractor Hub account. Creates a free 30-day trial.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Full name"
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "description": "Email address"
                    },
                    "phone": {
                        "type": "string",
                        "description": "Mobile number (South African)"
                    },
                    "password": {
                        "type": "string",
                        "description": "Account password (min 8 chars)"
                    }
                },
                "required": [
                    "name",
                    "email",
                    "password"
                ]
            }
        },
        {
            "name": "request_sos_dispatch",
            "description": "Submit an emergency SOS dispatch request. Notifies nearby contractors on the SOS network.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "client_name": {
                        "type": "string",
                        "description": "Your name"
                    },
                    "phone": {
                        "type": "string",
                        "description": "Contact number"
                    },
                    "trade": {
                        "type": "string",
                        "description": "Type of contractor needed (e.g. electrician, plumber)"
                    },
                    "description": {
                        "type": "string",
                        "description": "Brief description of the emergency"
                    },
                    "location": {
                        "type": "string",
                        "description": "Address or area"
                    }
                },
                "required": [
                    "client_name",
                    "phone",
                    "trade",
                    "description"
                ]
            }
        },
        {
            "name": "open_onboarding",
            "description": "Open the Contractor Hub support chat and automatically start the onboarding wizard. Walks the user through sign-up, business details, banking setup, and WhatsApp Bot activation.",
            "inputSchema": {
                "type": "object",
                "properties": {},
                "required": []
            }
        },
        {
            "name": "navigate_to",
            "description": "Scroll to a named section on the Contractor Hub landing page, or navigate to a sub-page.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "section": {
                        "type": "string",
                        "description": "Section name to navigate to.",
                        "enum": [
                            "pricing",
                            "sos",
                            "whatsapp",
                            "contractor",
                            "features",
                            "faq",
                            "claim",
                            "register",
                            "login",
                            "demo"
                        ]
                    }
                },
                "required": [
                    "section"
                ]
            }
        },
        {
            "name": "prefill_signup",
            "description": "Pre-fill the Contractor Hub registration form with the provided details and navigate the user to the sign-up page. The user must review and submit the form themselves.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Full name"
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "description": "Email address"
                    },
                    "phone": {
                        "type": "string",
                        "description": "Mobile number"
                    },
                    "biz_name": {
                        "type": "string",
                        "description": "Business / company name"
                    }
                },
                "required": [
                    "name",
                    "email"
                ]
            }
        }
    ]
}