{
    "tools": [
        {
            "name": "list_api_methods",
            "description": "Lists available Telerivet API methods with name, description, and parameter summary. Use 'category' to filter by execution tool.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "category": {
                        "type": "string",
                        "enum": [
                            "read_api",
                            "modify_api",
                            "delete_api",
                            "send_api"
                        ],
                        "description": "Filter by execution tool category"
                    }
                }
            },
            "annotations": {
                "title": "List API Methods",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "get_method_schema",
            "description": "Returns full parameter schema and response field descriptions for a specific Telerivet API method. For service config methods (Project_createService, Service_setConfig, Service_getConfig), also returns a service_types summary. Pass service_type to get detailed config_schema or actions_schema for that type (cloud script types include a pointer to the Cloud Script API reference, served by get_documentation). Set include_variables to true to get available template variables and filters for methods that support [[variable]] syntax.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "method_name": {
                        "type": "string",
                        "description": "Method name (e.g. Project_queryContacts)"
                    },
                    "service_type": {
                        "type": "string",
                        "description": "Optional service type to get detailed config schema (only for Project_createService, Service_setConfig, Service_getConfig)"
                    },
                    "include_variables": {
                        "type": "boolean",
                        "description": "Set to true to include available template variables and filters in the response (for methods that support [[variable]] syntax)"
                    }
                },
                "required": [
                    "method_name"
                ]
            },
            "annotations": {
                "title": "Get API Method Details",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "get_web_app_urls",
            "description": "Returns Telerivet web app URL patterns and page details for linking users to features, including functionality not available via the API (sending, contacts, scheduling, statistics, user permissions, and more). Without a query, returns a compact index of all pages (titles and URL patterns); with keywords or a URL path (e.g. \"schedule messages\" or \"/p/abc123/contacts\"), returns full details for the matching pages including supported query parameters and available actions.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "type": "string",
                        "description": "Keywords (e.g. \"message statistics\"), or a web app URL or path (e.g. \"/p/abc123/messages\") to match a specific page. Omit to get a compact index of all pages."
                    }
                }
            },
            "annotations": {
                "title": "Get Web App Details",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "read_api",
            "description": "Executes a read-only method of the Telerivet REST API (https://telerivet.com/api/rest) to retrieve data from Telerivet. Safe, no side effects.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "method_name": {
                        "type": "string",
                        "description": "API method name (see list_api_methods)",
                        "enum": [
                            "API_getOrganizationById",
                            "API_getProjectById",
                            "API_queryOrganizations",
                            "API_queryProjects",
                            "Contact_queryDataRows",
                            "Contact_queryGroups",
                            "Contact_queryMessages",
                            "Contact_queryScheduledMessages",
                            "Contact_queryServiceStates",
                            "Dashboard_getCardById",
                            "Dashboard_queryCards",
                            "DataTable_countRowsByValue",
                            "DataTable_getFields",
                            "DataTable_getRowById",
                            "DataTable_getViewById",
                            "DataTable_queryRows",
                            "DataTable_queryViews",
                            "DataView_queryRows",
                            "Group_queryContacts",
                            "Group_queryScheduledMessages",
                            "Label_queryMessages",
                            "Organization_getAvailablePlans",
                            "Organization_getBillingDetails",
                            "Organization_getBillingTransactionTotals",
                            "Organization_getMessageStats",
                            "Organization_getUsage",
                            "Organization_getUsageHistory",
                            "Organization_queryBillingTransactions",
                            "Organization_queryProjects",
                            "Phone_queryMessages",
                            "Project_getAirtimeStats",
                            "Project_getAirtimeTransactionById",
                            "Project_getBroadcastById",
                            "Project_getCampaignById",
                            "Project_getContactById",
                            "Project_getContactFields",
                            "Project_getContactStats",
                            "Project_getDashboardById",
                            "Project_getDataTableById",
                            "Project_getDataTableStats",
                            "Project_getFileById",
                            "Project_getGroupById",
                            "Project_getLabelById",
                            "Project_getMessageById",
                            "Project_getMessageFields",
                            "Project_getMessageStats",
                            "Project_getMessageTemplateById",
                            "Project_getPhoneById",
                            "Project_getRelativeScheduledMessageById",
                            "Project_getRouteById",
                            "Project_getRouteList",
                            "Project_getScheduledMessageById",
                            "Project_getScheduledServiceById",
                            "Project_getServiceById",
                            "Project_getSolutionById",
                            "Project_getTaskById",
                            "Project_getUsers",
                            "Project_getWebhookById",
                            "Project_queryAirtimeTransactions",
                            "Project_queryBroadcasts",
                            "Project_queryCampaigns",
                            "Project_queryContacts",
                            "Project_queryDashboards",
                            "Project_queryDataTables",
                            "Project_queryFiles",
                            "Project_queryGroups",
                            "Project_queryLabels",
                            "Project_queryMessageTemplates",
                            "Project_queryMessages",
                            "Project_queryPhones",
                            "Project_queryRelativeScheduledMessages",
                            "Project_queryRoutes",
                            "Project_queryScheduledMessages",
                            "Project_queryScheduledServices",
                            "Project_queryServiceLogs",
                            "Project_queryServices",
                            "Project_querySolutions",
                            "Project_queryTasks",
                            "Project_queryWebhooks",
                            "Service_getConfig",
                            "Service_getContactState",
                            "Service_queryContactStates"
                        ]
                    },
                    "arguments": {
                        "type": "object",
                        "description": "Method arguments (see get_method_schema for parameter details)"
                    }
                },
                "required": [
                    "method_name",
                    "arguments"
                ],
                "additionalProperties": false
            },
            "annotations": {
                "title": "Read Telerivet Data",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "modify_api",
            "description": "Executes a method of the Telerivet REST API (https://telerivet.com/api/rest) that creates or updates data in Telerivet.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "method_name": {
                        "type": "string",
                        "description": "API method name (see list_api_methods)",
                        "enum": [
                            "Broadcast_cancel",
                            "Campaign_save",
                            "Campaign_unschedule",
                            "Contact_addToGroup",
                            "Contact_save",
                            "DashboardCard_save",
                            "Dashboard_createCard",
                            "Dashboard_save",
                            "DataRow_save",
                            "DataTable_createRow",
                            "DataTable_createView",
                            "DataTable_importRows",
                            "DataTable_save",
                            "DataTable_updateFields",
                            "DataView_save",
                            "Group_save",
                            "Label_save",
                            "MessageTemplate_save",
                            "Message_addLabel",
                            "Message_cancel",
                            "Message_save",
                            "Organization_createProject",
                            "Organization_save",
                            "Phone_resetSentMessageCount",
                            "Phone_save",
                            "Project_createCampaign",
                            "Project_createDashboard",
                            "Project_createDataTable",
                            "Project_createGroup",
                            "Project_createMessageTemplate",
                            "Project_createPhone",
                            "Project_createRoute",
                            "Project_createService",
                            "Project_createSolution",
                            "Project_createWebhook",
                            "Project_getOrCreateContact",
                            "Project_getOrCreateDataTable",
                            "Project_getOrCreateGroup",
                            "Project_getOrCreateLabel",
                            "Project_importContacts",
                            "Project_save",
                            "Project_updateContactFields",
                            "Project_updateMessageFields",
                            "Project_uploadFile",
                            "Route_save",
                            "Service_save",
                            "Service_setConfig",
                            "Service_setContactState",
                            "Solution_save",
                            "StoredFile_save",
                            "Task_cancel",
                            "Webhook_save"
                        ]
                    },
                    "arguments": {
                        "type": "object",
                        "description": "Method arguments (see get_method_schema for parameter details)"
                    }
                },
                "required": [
                    "method_name",
                    "arguments"
                ],
                "additionalProperties": false
            },
            "annotations": {
                "title": "Update Telerivet",
                "readOnlyHint": false,
                "destructiveHint": true,
                "openWorldHint": false
            }
        },
        {
            "name": "delete_api",
            "description": "Executes a method of the Telerivet REST API (https://telerivet.com/api/rest) that deletes data from Telerivet.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "method_name": {
                        "type": "string",
                        "description": "API method name (see list_api_methods)",
                        "enum": [
                            "Campaign_delete",
                            "Contact_delete",
                            "Contact_removeFromGroup",
                            "DashboardCard_delete",
                            "Dashboard_delete",
                            "DataRow_delete",
                            "DataTable_delete",
                            "DataView_delete",
                            "Group_delete",
                            "Label_delete",
                            "MessageTemplate_delete",
                            "Message_delete",
                            "Message_removeLabel",
                            "RelativeScheduledMessage_delete",
                            "ScheduledMessage_delete",
                            "ScheduledService_delete",
                            "Service_delete",
                            "Service_resetContactState",
                            "Solution_delete",
                            "StoredFile_delete",
                            "Webhook_delete"
                        ]
                    },
                    "arguments": {
                        "type": "object",
                        "description": "Method arguments (see get_method_schema for parameter details)"
                    }
                },
                "required": [
                    "method_name",
                    "arguments"
                ],
                "additionalProperties": false
            },
            "annotations": {
                "title": "Delete Telerivet Data",
                "readOnlyHint": false,
                "destructiveHint": true,
                "openWorldHint": false
            }
        },
        {
            "name": "send_api",
            "description": "Executes a method of the Telerivet REST API (https://telerivet.com/api/rest) that sends or schedules messages, invokes automated services, or creates batch tasks via Telerivet. Has external side effects (sends text messages, makes calls, performs bulk operations, etc.).",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "method_name": {
                        "type": "string",
                        "description": "API method name (see list_api_methods)",
                        "enum": [
                            "Campaign_send",
                            "Message_resend",
                            "Message_sendReadReceipt",
                            "Message_sendTypingIndicator",
                            "Project_createRelativeScheduledMessage",
                            "Project_createTask",
                            "Project_receiveMessage",
                            "Project_scheduleMessage",
                            "Project_scheduleService",
                            "Project_sendBroadcast",
                            "Project_sendMessage",
                            "Project_sendMulti",
                            "RelativeScheduledMessage_save",
                            "ScheduledMessage_approve",
                            "ScheduledMessage_save",
                            "ScheduledService_save",
                            "Service_invoke"
                        ]
                    },
                    "arguments": {
                        "type": "object",
                        "description": "Method arguments (see get_method_schema for parameter details)"
                    }
                },
                "required": [
                    "method_name",
                    "arguments"
                ],
                "additionalProperties": false
            },
            "annotations": {
                "title": "Send via Telerivet",
                "readOnlyHint": false,
                "destructiveHint": true,
                "idempotentHint": false,
                "openWorldHint": true
            }
        },
        {
            "name": "draft_message",
            "description": "Draft a message for review before sending. Shows an interactive preview where the user can edit and confirm the message.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "to_numbers": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "List of phone numbers to send to"
                    },
                    "group_id": {
                        "type": "string",
                        "description": "ID of a contact group to send to (the group name and member count are looked up automatically and shown to the user)"
                    },
                    "content": {
                        "type": "string",
                        "description": "Message content"
                    },
                    "route_id": {
                        "type": "string",
                        "description": "Route ID to send from (optional)"
                    },
                    "project_id": {
                        "type": "string",
                        "description": "Project ID"
                    },
                    "draft_id": {
                        "type": "string",
                        "description": "Unique random identifier for this draft (used to prevent duplicate sends). The client must generate a unique ID each time this tool is called, e.g. a random UUID."
                    }
                },
                "required": [
                    "content",
                    "project_id",
                    "draft_id"
                ]
            },
            "_meta": {
                "ui": {
                    "resourceUri": "ui://telerivet/draft_message"
                }
            },
            "annotations": {
                "title": "Draft Message",
                "readOnlyHint": false,
                "openWorldHint": true,
                "destructiveHint": false
            }
        },
        {
            "name": "get_route_options",
            "description": "Returns available messaging route/channel options to help choose a provider and channel type, or details about an existing route type: geographic availability, use cases, compliance and registration requirements, billing modes (internal/Telerivet-managed vs external/BYOC), setup timelines, and per-message pricing. Without arguments, returns a compact index of all route types; use 'country' to filter by availability and get full details including pricing, or use 'phone_type' for full details on a specific route type.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "country": {
                        "type": "string",
                        "description": "ISO 2-letter country code to filter by geographic availability and include pricing (e.g. US, GB, KE)"
                    },
                    "channel_type": {
                        "type": "string",
                        "enum": [
                            "sms",
                            "mms",
                            "voice",
                            "whatsapp",
                            "viber",
                            "rcs",
                            "ussd",
                            "chat"
                        ],
                        "description": "Filter by channel/message type"
                    },
                    "use_case": {
                        "type": "string",
                        "enum": [
                            "marketing",
                            "otp",
                            "notifications",
                            "customer_support"
                        ],
                        "description": "Filter by intended use case"
                    },
                    "phone_type": {
                        "type": "string",
                        "description": "Route type identifier for full details (same as the phone_type property on a phone/basic route)"
                    }
                }
            },
            "annotations": {
                "title": "Get Route Options",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "skillbook_search",
            "description": "Search Telerivet's Skillbook for solution patterns, services, campaign types, platform features, message templates, and integrations matching an intent or use case. The Skillbook describes what can be built on Telerivet and how to set it up. Call this before recommending Cloud Script or custom code \u2014 native services and solution patterns cover most use cases. Use skillbook_get for full details on any result.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "intent_tags": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "acquisition",
                                "commerce-and-loyalty",
                                "connectivity-and-integration",
                                "data-and-identity",
                                "engagement",
                                "feedback-and-intelligence",
                                "alerting",
                                "appointment-reminders",
                                "automated-execution",
                                "automation",
                                "broadcasts",
                                "cloud-script",
                                "contact-registration",
                                "contest",
                                "conversational-ai",
                                "crm-enrichment",
                                "custom-logic",
                                "customer-intake",
                                "customer-recognition",
                                "customer-self-service",
                                "customer-support",
                                "data-collection",
                                "delivery-reliability",
                                "drip-marketing",
                                "enroll",
                                "event-driven",
                                "feedback-collection",
                                "field-operations",
                                "fulfillment",
                                "incentives",
                                "inquiry-handling",
                                "lifecycle-messaging",
                                "mass-dispatch",
                                "mobile-money",
                                "nps",
                                "nurture",
                                "onboarding",
                                "opt-in",
                                "opt-out",
                                "otp-auth",
                                "password-reset",
                                "points-management",
                                "poll",
                                "promo-codes",
                                "receipt-processing",
                                "reference-ids",
                                "referral",
                                "register",
                                "registration",
                                "rest-api",
                                "service-orchestration",
                                "single-api-gateway",
                                "subscriber-growth",
                                "team-collaboration",
                                "triage",
                                "ussd-interaction",
                                "value-transfer",
                                "voice-interaction",
                                "webhook",
                                "winner-selection",
                                "zendesk"
                            ]
                        },
                        "description": "Intent tags to match. Primary discovery surface."
                    },
                    "industry_tags": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "aggregator",
                                "agribusiness",
                                "agriculture",
                                "automotive",
                                "bpo",
                                "ecommerce",
                                "education",
                                "energy",
                                "entertainment",
                                "events",
                                "financial-services",
                                "fintech",
                                "fmcg",
                                "gaming",
                                "government",
                                "grocery",
                                "healthcare",
                                "home-services",
                                "hospitality",
                                "insurance",
                                "logistics",
                                "market-research",
                                "media",
                                "ngo",
                                "pharmaceuticals",
                                "professional-services",
                                "property-management",
                                "real-estate",
                                "research",
                                "retail",
                                "retail-ecommerce",
                                "ride-share",
                                "ride-sharing",
                                "staffing",
                                "telecom",
                                "transportation",
                                "utilities",
                                "veterinary",
                                "wellness"
                            ]
                        },
                        "description": "Industry tags to filter results."
                    },
                    "keywords": {
                        "type": "string",
                        "description": "Free-text search across names, taglines, and descriptions"
                    },
                    "entity_types": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "solution",
                                "service",
                                "campaignPattern",
                                "messageTemplate",
                                "platformFeature",
                                "integration"
                            ]
                        },
                        "description": "Filter by entity type (default: all types)"
                    }
                }
            },
            "annotations": {
                "title": "Search Skillbook",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "skillbook_get",
            "description": "Get the full details for a specific Skillbook entity \u2014 including composition, dependencies, onboarding steps, and API surface guidance for MCP execution. Use the entity_type and slug from skillbook_search results.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "entity_type": {
                        "type": "string",
                        "enum": [
                            "solution",
                            "service",
                            "campaignPattern",
                            "messageTemplate",
                            "platformFeature",
                            "integration"
                        ],
                        "description": "Entity type"
                    },
                    "slug": {
                        "type": "string",
                        "description": "Slug identifier (from skillbook_search results)"
                    }
                },
                "required": [
                    "entity_type",
                    "slug"
                ]
            },
            "annotations": {
                "title": "Get Skillbook Entry",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "search_documentation",
            "description": "Search Telerivet documentation: User Guide help articles, legal/policy pages, developer API documentation (integrations, OAuth, MCP, Rules Engine, Webhook/REST/Cloud Script APIs \u2014 the per-method API reference is NOT here; use get_method_schema for that), and marketing/company content on www.telerivet.com. Use for procedural, troubleshooting, feature, policy, developer, and company questions. Returns matching documents with title, URL, source type, a highlighted snippet, and an id for get_documentation, plus total and has_more \u2014 if has_more is true and no clearly relevant result appears, refine the query, narrow with the source filter, or raise per_page (max 25).",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "query": {
                        "type": "string",
                        "description": "Free-text search query"
                    },
                    "per_page": {
                        "type": "integer",
                        "description": "Max number of results to return (1-25, default 10)",
                        "minimum": 1,
                        "maximum": 25
                    },
                    "source": {
                        "type": "string",
                        "description": "Optional source filter ('web_app' is the web app page/URL catalog, also searchable via get_web_app_urls). Omit to search everything.",
                        "enum": [
                            "user_guide",
                            "legal",
                            "api_docs",
                            "marketing",
                            "web_app"
                        ]
                    }
                },
                "required": [
                    "query"
                ]
            },
            "annotations": {
                "title": "Search Documentation",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "get_documentation",
            "description": "Retrieve the full text of a specific documentation entry by its id (obtained from search_documentation results \u2014 ids look like 'user_guide:360038959391' or 'legal:terms'). Returns title, URL, source, and the body as plain text. Some user-guide articles have screenshots included as Markdown-formatted images. The Cloud Script API TypeScript reference is available with id 'cloud_script_api'.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "Document id from search_documentation results"
                    }
                },
                "required": [
                    "id"
                ]
            },
            "annotations": {
                "title": "Get Documentation",
                "readOnlyHint": true,
                "destructiveHint": false,
                "openWorldHint": false
            }
        },
        {
            "name": "run_analysis_script",
            "description": "Run read-only JavaScript to analyze project data \u2014 use this instead of paging large datasets through query tools when a question involves aggregation, joins across entity types, or more than a page of records. The code runs in Telerivet's Cloud Script API sandbox (synchronous JavaScript) with the `project` global set when a project is bound (undefined in organization-only runs with no project_id), plus an `organization` global for organization-level data (billing details and transactions, usage, the organization's projects) \u2014 organization methods work only where the user's own permissions allow. Write top-level statements \u2014 do NOT wrap the code in a main() function \u2014 and end with a top-level `return <value>` returning a compact JSON-serializable result (counts, samples, summaries \u2014 never full datasets); use console.log(...) for progress output. Each run has limited execution time and API requests (12 seconds / 250 requests unless the project's admin settings allow more): prefer cursor.count() and filtered queries over scanning every record, avoid one API call per record, and bound big jobs with cursor.limit(n), processing one segment per run. The tool returns a 'usage' property that contains usage telemetry alongside the run's limits, so that the model can tune batch sizes across successive runs. For genuinely large bulk operations, create an asynchronous batch task instead (project.createTask, or the Project_createTask API method), which processes all matching records server-side without these limits. Use get_method_schema for JavaScript example code for a specific method, and call get_documentation with id 'cloud_script_api' for the Cloud Script API reference \u2014 check it before writing nontrivial code rather than guessing method signatures. This tool's API access is READ-ONLY: methods that create, update, send, or delete fail, and HTTP requests are disabled. To perform changes, use run_script instead.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "JavaScript code to execute (Cloud Script API, read-only)"
                    },
                    "project_id": {
                        "type": "string",
                        "description": "ID of the project to run the script in (call API_queryProjects to look up a project ID if you don't already have one). Optional: omit it to run in organization-only context \u2014 the `project` global is then undefined, while the `organization` global is still available (e.g. for billing or usage questions)."
                    }
                },
                "required": [
                    "code"
                ]
            },
            "annotations": {
                "title": "Run Analysis Code",
                "readOnlyHint": true,
                "openWorldHint": false,
                "destructiveHint": false
            }
        },
        {
            "name": "run_script",
            "description": "Run JavaScript with full Cloud Script API access (reads, writes, sending, HTTP requests) \u2014 use this for bulk changes that would otherwise take many individual API calls, such as importing or cleaning up many records. Write the code exactly as described for run_analysis_script (same sandbox, limits, and documentation references). Use batch methods (e.g. importContacts) when available. Can make HTTP requests, e.g. to import or export data without passing it through model context. This tool makes changes with the user's full API access: show the user the code and what it will do before calling, and keep it short, readable, and single-purpose. Prefer run_analysis_script for anything that doesn't change data.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "JavaScript code to execute (Cloud Script API, full access)"
                    },
                    "summary": {
                        "type": "string",
                        "description": "One-sentence plain-language summary of what this script is intended to do, shown to the user in the confirmation prompt alongside the code (always provide this)"
                    },
                    "project_id": {
                        "type": "string",
                        "description": "ID of the project to run the script in (call API_queryProjects to look up a project ID if you don't already have one). Optional: omit it to run in organization-only context \u2014 the `project` global is then undefined, while the `organization` global is still available (e.g. for billing or usage questions)."
                    }
                },
                "required": [
                    "code"
                ]
            },
            "annotations": {
                "title": "Run Code",
                "readOnlyHint": false,
                "openWorldHint": true,
                "destructiveHint": true,
                "idempotentHint": false
            }
        }
    ]
}