# Placetel MCP

> Placetel MCP Server connects your AI client to your Placetel PBX data. It lets agents programmatically list users, retrieve SIP endpoints, check active calls, and pull detailed call logs (CDRs) instantly. Use it to automate tasks like auditing user groups or finding specific phone numbers without touching a dashboard.

## Overview
- **Category:** communication-messaging
- **Price:** Free
- **Tags:** cloud-pbx, sip-trunking, call-routing, telephony-api, call-detail-records

## Description

The Placetel MCP Server plugs your AI client right into your PBX data. You never gotta log into some dashboard just to check basic info; you'll connect your agent and it instantly gets access to all core telephony functions. This lets your team automate tasks—like auditing who belongs in which group, or pulling a specific number's technical details—without touching a single portal button.

**User Account Management:** 
You can get a rundown of every active Placetel user account using `list_users`, and if you know the ID, you'll pull all the specific account info with `get_user`. For group structures, it’s simple: use `list_groups` to see every existing user group name, then run `get_group` if you need the deep details on one specific membership. 

**System Inventory:** 
Need to know what numbers your company uses? You get a full inventory of all assigned phone numbers with `list_numbers`. To track hardware and software, `list_devices` gives you a rundown of every physical or soft device registered in the system. On the technical side, it’s no different: `list_sip_users` shows every SIP account available on the PBX, and if you're checking credentials for one specific user, `get_sip_user` pulls all that required technical information.

**Group & User Details:** 
The server handles both general accounts and defined groups. You can use `list_groups` to see what group names are available across your account, and then you’ll pull the full details on a specific membership using `get_group`. For individual user records, finding an account's basic info is done with `get_user`, while checking out all active accounts starts by running `list_users`.

**Call Auditing & Records:** 
When it comes to call data, you’ve got two main tools. First, if you just need a quick status check, `list_calls` shows you every phone call that's currently ringing or recently ended. For serious logging—like billing or compliance audits—you use `list_call_detail_records`. This tool pulls the full Call Detail Records (CDRs), giving you comprehensive logs of who called whom, how long it lasted, and which parties were involved. You can also get a list of every registered SIP user account using `list_sip_users`.

***

**Putting It Together:** 
This whole setup means your agent doesn't just check one thing; you're building an audit pipeline. For example, you can pull all the assigned numbers with `list_numbers`, then use that list to cross-reference against which users are active via `list_users`. You can get a full list of every device using `list_devices` and pair that up with checking the technical credentials for specific accounts through `get_sip_user`. If you're tracking usage, your agent can first check live status with `list_calls`, then immediately jump back in time to review historical data by grabbing all the CDRs via `list_call_detail_records`. You never have to switch contexts or open a different tab; everything runs through this one connection. It’s built for deep, programmatic dives into your PBX infrastructure.

## Tools

### get_group
Gets the specific details for a defined Placetel user group.

### get_sip_user
Retrieves all technical information about a specified SIP endpoint.

### get_user
Gets the account details for any single Placetel user.

### list_call_detail_records
Pulls comprehensive logs of every call made or received, including duration and parties involved.

### list_calls
Shows a list of calls that are currently active or recently terminated.

### list_devices
Lists every physical and soft device registered with the Placetel system.

### list_groups
Returns a list of all existing user groups within your account.

### list_numbers
Provides an inventory of every assigned phone number in the system.

### list_sip_users
Lists all registered SIP user accounts available on the PBX.

### list_users
Retrieves a list of every active Placetel account user.

## Prompt Examples

**Prompt:** 
```
List all devices in Placetel.
```

**Response:** 
```
I retrieved your devices. Here are the active ones: 'Desk Phone 1', 'Softphone - John'.
```

**Prompt:** 
```
Get call details from today.
```

**Response:** 
```
Here are your Call Detail Records for today, including 5 inbound calls and 3 outbound calls.
```

**Prompt:** 
```
List all users in my account.
```

**Response:** 
```
You have 2 users in your account: 'Admin' and 'Sales'.
```

## Capabilities

### Get User Details
Retrieve specific information about a user account by identifier.

### Manage Groups
List all available Placetel groups or get details for a single specified group.

### Check SIP Endpoints
Retrieve technical details for a specific SIP user account.

### Audit Calls and CDRs
List all active or recent calls, or pull full Call Detail Records (CDRs) for billing/logging purposes.

### Inventory Devices & Numbers
Get a complete list of connected devices or all assigned phone numbers within the account.

## Use Cases

### Troubleshooting an Outage
A call failed and the user only has a reference ID. Instead of manually cross-referencing that ID across the dashboard, the agent runs `list_call_detail_records` using the ID. The result immediately shows if the failure was due to a device issue or an incorrect number assignment.

### Onboarding New Teams
The ops engineer needs to verify every user has the correct permissions. They run `list_users` to get all accounts, then call `get_group` for each department group to confirm proper role assignment before activation.

### Billing Audit
Compliance requires proof of all calls made last quarter. The agent runs `list_call_detail_records` over the specified date range, automatically filtering and summarizing call duration and destination parties for the finance team.

### Inventory Cleanup
The IT admin needs to decommission an old branch office's equipment. They run `list_devices` to get a definitive list of all associated endpoints, ensuring nothing is missed before powering down the physical gear.

## Benefits

- Instantly audit call history. Instead of downloading massive CSVs from a dashboard, run `list_call_detail_records` to pull structured data directly into your agent for analysis.
- Verify endpoints quickly. Need to know if John's desk phone is registered? Call `list_devices` and get the status immediately, eliminating manual portal checks.
- Manage users by role. Use `get_group` or `list_groups` to check which users belong to specific call routing groups without guesswork.
- See real-time activity. The `list_calls` tool gives an immediate snapshot of active calls—perfect for troubleshooting during a live outage.
- Full inventory access. Run `list_numbers` to audit your entire number pool, ensuring no numbers are missed when planning new extensions.

## How It Works

The bottom line is that your agent gets a structured view of all Placetel data without requiring manual logins or complex API scripting.

1. You connect your AI client using an API Token and point it to the Placetel MCP endpoint.
2. The agent calls a specific tool function (e.g., `list_call_detail_records`) by telling it exactly what data you need.
3. The server executes the call against Placetel's backend, processes the request, and sends back structured JSON data to your AI client.

## Frequently Asked Questions

**How do I find out which devices are registered using list_devices?**
You simply call the `list_devices` tool. It returns a complete inventory, including device names and their current connection status (e.g., online/offline).

**What is the best way to audit calls using list_call_detail_records?**
To get comprehensive logs, run `list_call_detail_records`. You can then filter this data by date range or specific user ID within your agent prompt for focused results.

**Do I need to call list_users before getting details with get_user?**
No. While `list_users` gives you an overview, you can directly use `get_user` by providing the specific user ID or username to retrieve all their detailed account information.

**How do I check if a group exists using list_groups?**
Call `list_groups`. This tool returns a comprehensive list of every defined group name. You can then use that name in the `get_group` function for full details.

**How do I use list_numbers to check all available phone numbers?**
It lists every number tied to your Placetel account. The output gives you the number ID and its status, letting your agent quickly verify if a number is active or assigned.

**What credentials does get_sip_user require for a specific SIP user?**
It requires the unique identifier of the SIP user. Your agent uses this ID to fetch detailed information, including associated devices and account status.

**Are there performance limits when calling list_calls repeatedly?**
The Placetel API handles a large volume of call data. If your agent makes too many calls in rapid succession, you might hit rate limits; waiting about one minute usually resolves it.

**What happens if I get an error using get_group?**
The tool returns a precise error code and message. This tells your agent exactly why the group lookup failed—whether it's due to an invalid ID or a permissions issue.

**Where do I find my API Token?**
Your API Token can be found in your Placetel web portal under Integrations > Web API.

**What access does this MCP need?**
It requires the REST API Token, giving access to users, calls, numbers, and devices.

**Can I initiate phone calls using this server?**
Currently, this integration supports retrieving Placetel data like CDRs and configurations. Call initiation via CTI will be added in a future update.