Repository navigation
Tools
This page documents all MCP tools exposed by the TP-Link Omada MCP server and the Omada APIs they rely on.
All tools are registered in src/tools/index.ts:
export function registerAllTools(server: McpServer, client: OmadaClient): void {
registerListSitesTool(server, client);
registerListDevicesTool(server, client);
registerListClientsTool(server, client);
registerGetDeviceTool(server, client);
registerGetSwitchStackDetailTool(server, client);
registerGetClientTool(server, client);
registerSearchDevicesTool(server, client);
registerListDevicesStatsTool(server, client);
registerListMostActiveClientsTool(server, client);
registerListClientsActivityTool(server, client);
registerListClientsPastConnectionsTool(server, client);
registerGetThreatListTool(server, client);
registerCallApiTool(server, client);
}From the project README:
| Tool | Description |
|---|---|
listSites |
Lists all sites configured on the controller. |
listDevices |
Lists provisioned devices for a given site. |
listClients |
Lists active client devices for a site. |
getDevice |
Fetches details for a specific Omada device. |
getSwitchStackDetail |
Retrieves detailed configuration and status for a switch stack. |
getClient |
Fetches details for a specific client device. |
searchDevices |
Searches for devices globally across all sites the user has access to. |
listDevicesStats |
Queries statistics for global adopted devices with pagination and filtering. |
listMostActiveClients |
Lists most active clients sorted by traffic. |
listClientsActivity |
Time-series client activity (new, active, disconnected). |
listClientsPastConnections |
Past client connections with pagination and filters. |
getThreatList |
Global threat management list with filters. |
callApi |
Executes a raw API request using the established Omada session token. |
Below, each tool is described with its purpose, typical Omada API mapping, and an example MCP invocation.
OmadaClient method: listSites()
Likely Omada API: GET /openapi/v1/{omadacId}/sites
Lists all Omada sites visible to the configured OAuth client.
Input
- None.
Example
Usage
- Discover available sites before using site-specific tools like
listDevicesorlistClients.
OmadaClient method: listDevices(siteId?: string)
Likely Omada API: GET /openapi/v1/{omadacId}/sites/{siteId}/devices
Lists adopted devices (switches, APs, gateways, etc.) at a site.
Input
-
siteId?: string– if omitted, defaults toOMADA_SITE_ID.
Example
{
"tool": "listDevices",
"arguments": {
"siteId": "site-01"
}
}Usage
- Inventory devices at a site and feed them into other tools (e.g.
getDevice).
OmadaClient method: getDevice(identifier: string, siteId?: string)
Likely Omada API: GET /openapi/v1/{omadacId}/sites/{siteId}/devices/{deviceId}
Fetches details for a specific device (by ID or MAC, depending on implementation).
Input (simplified)
-
deviceId: string(oridentifier) siteId?: string
Example
{
"tool": "getDevice",
"arguments": {
"deviceId": "00-11-22-33-44-55",
"siteId": "site-01"
}
}Usage
- Drill into a device returned from
listDevicesto get model, firmware, status, and other attributes.
OmadaClient method: getSwitchStackDetail(stackId: string, siteId?: string)
Likely Omada API: GET /openapi/v1/{omadacId}/sites/{siteId}/osw-stacks/{stackId}
Provides detailed information about a switch stack and its member devices.
Input
stackId: stringsiteId?: string
Example
{
"tool": "getSwitchStackDetail",
"arguments": {
"stackId": "stack-01",
"siteId": "site-01"
}
}Usage
- Inventory stack membership and roles.
- Troubleshoot stack-level issues.
OmadaClient method: listClients(siteId?: string)
Likely Omada API: GET /openapi/v1/{omadacId}/sites/{siteId}/clients
Lists active clients at a site (wired/wireless).
Input
siteId?: string
Example
{
"tool": "listClients",
"arguments": {
"siteId": "site-01"
}
}Usage
- Discover which devices are currently connected.
- Combine with
getClientto drill into a specific client.
OmadaClient method: getClient(identifier: string, siteId?: string)
Likely Omada API: GET /openapi/v1/{omadacId}/sites/{siteId}/clients/{clientIdOrMac}
Fetches details for a specific client by ID or MAC.
Implementation (src/tools/getClient.ts)
server.registerTool(
'getClient',
{
description: 'Fetch details for a specific Omada client.',
inputSchema: clientIdSchema.shape,
},
wrapToolHandler('getClient', async ({ clientId, siteId }) =>
toToolResult(await client.getClient(clientId, siteId)),
),
);Input
clientId: stringsiteId?: string
Example
{
"tool": "getClient",
"arguments": {
"clientId": "aa:bb:cc:dd:ee:ff",
"siteId": "site-01"
}
}OmadaClient method: searchDevices(searchKey: string)
Likely Omada API: GET /openapi/v1/{omadacId}/devices/search?searchKey=... or similar.
Searches devices across all accessible sites by fuzzy key (name, MAC, model, etc.).
Input
searchKey: string
Example
{
"tool": "searchDevices",
"arguments": {
"searchKey": "Core-Switch"
}
}Usage
- Find a device when you only know part of its name, model, or MAC.
OmadaClient method: listDevicesStats(options: GetDeviceStatsOptions)
Likely Omada API: GET /openapi/v1/{omadacId}/devices/stats with query params.
Returns statistics for adopted devices with pagination and filters.
Input (simplified)
GetDeviceStatsOptions typically includes:
-
page,pageSize - filters by site, device type, model, etc.
Example
{
"tool": "listDevicesStats",
"arguments": {
"page": 1,
"pageSize": 50,
"siteId": "site-01"
}
}Usage
- Build dashboards summarizing device health and utilization.
OmadaClient method: listMostActiveClients(siteId?: string)
Omada API operation ID (from README): getMostActiveClients
Retrieves most active clients, typically by traffic volume.
Input
siteId?: string
Example
{
"tool": "listMostActiveClients",
"arguments": {
"siteId": "site-01"
}
}Usage
- Identify bandwidth-heavy clients on a given site.
OmadaClient method: listClientsActivity(options?: GetClientActivityOptions)
Omada API operation ID: getClientActivity
Provides time-series data for client activity (new, active, disconnected).
Input
siteId?: string- time range and other parameters in
GetClientActivityOptions.
Example
{
"tool": "listClientsActivity",
"arguments": {
"siteId": "site-01",
"startTime": "2025-01-01T00:00:00Z",
"endTime": "2025-01-02T00:00:00Z"
}
}Usage
- Visualizing client trends (e.g. in dashboards).
- Capacity planning and historical analysis.
OmadaClient method: listClientsPastConnections(options: ListClientsPastConnectionsOptions)
Omada API operation ID: getGridPastConnections
Lists past client connections with pagination, filtering, and sorting.
Input
ListClientsPastConnectionsOptions typically includes:
- pagination (
page,pageSize) - filters (siteId, MAC, etc.)
- sorting options
Usage
- Audit historical client access.
- Correlate user reports with past connectivity events.
OmadaClient method: getThreatList(options: GetThreatListOptions)
Omada API operation ID: getGlobalThreatList
Fetches a global view threat management list with filters.
Input
GetThreatListOptions typically includes:
-
startTime,endTime -
severity, site filters, pagination.
Usage
- Security monitoring and incident investigation.
- High-level security overview for the controller.
File: src/tools/callApi.ts
OmadaClient method: callApi<T>(config: AxiosRequestConfig)
Implementation:
export function registerCallApiTool(server: McpServer, client: OmadaClient): void {
server.registerTool(
'callApi',
{
description:
'Call an arbitrary API path on the Omada controller. The provided URL should be a path, for example /openapi/v1/{omadacId}/sites',
inputSchema: customRequestSchema.shape,
},
wrapToolHandler('callApi', async ({ method, url, params, data, siteId }) => {
const resolvedUrl = siteId ? url.replace('{siteId}', siteId) : url;
const payload = await client.callApi({
method,
url: resolvedUrl,
params,
data,
});
return toToolResult(payload);
}),
);
}Input (from customRequestSchema)
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | ...-
url: string– path only, e.g./openapi/v1/{omadacId}/sites/{siteId}/devices -
params?: object– query parameters -
data?: object– JSON body (for POST/PUT) -
siteId?: string– optional; will replace{siteId}placeholder inurl.
Example: List sites via raw API
{
"tool": "callApi",
"arguments": {
"method": "GET",
"url": "/openapi/v1/{omadacId}/sites",
"params": {},
"data": null
}
}Example: List devices for a site using {siteId}
{
"tool": "callApi",
"arguments": {
"method": "GET",
"url": "/openapi/v1/{omadacId}/sites/{siteId}/devices",
"siteId": "site-01",
"params": {
"page": 1,
"pageSize": 100
}
}
}Why use callApi?
- Access Omada endpoints not yet wrapped by dedicated tools.
- Experiment with new OpenAPI features without changing server code.
- Perform advanced operations (e.g. specific POST/PUT calls) when the high-level tools are read-only.
For more on the transport and how to connect an MCP client to these tools, see HTTP Transport. For build/run instructions, see Development and Docker.
{ "tool": "listSites", "arguments": {} }