add-integration-api-tool

Guides adding MCP tools that use the UniFi Integration API with scoped ID families.

777|101|Updated Apr 21, 2025
One-click install
npx skills add https://github.com/sirkirby/unifi-network-mcp --skill add-integration-api-tool
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-integration-api-tool
Source: https://github.com/sirkirby/unifi-network-mcp/tree/main/.agents/skills/add-integration-api-tool
Command: npx skills add https://github.com/sirkirby/unifi-network-mcp --skill add-integration-api-tool

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The UniFi controller exposes two incompatible API surfaces (V2 controller API and Integration API) with different auth, ID namespaces, and field schemas. Mixing them causes silent failures where IDs from one API are passed to tools backed by the other. This Skill provides the rules for safely adding tools that talk to the UniFi Integration API.

Core Features & Use Cases

  • Tool Family Boundaries: Defines how to decide whether a new tool joins an existing ID family or starts a new one, with the current firewall policy CRUD and ordering families as reference.
  • ID Scoping Rules: Mandates scoping clauses in MCP tool, GraphQL, and REST descriptions so UUIDs from the Integration API are never confused with V2 Mongo ObjectIDs.
  • Auth and Bridging Patterns: Requires X-API-Key auth checks with remediation messages, bans silent ID translation except the grandfathered zone case, and prescribes named bridging tools when cross-namespace lookup is genuinely needed.
  • Use Case: When adding a new firewall policy ordering tool backed by the Integration API, follow the steps to scope its UUIDs, wire the API-key check in the manager, and add tests covering the family boundary.

Quick Start

Ask the agent to add a new UniFi Integration API tool following the add-integration-api-tool skill, specifying the endpoint and whether it reads or mutates resources.

Frequently Asked Questions about add-integration-api-tool

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a tool that uses the UniFi Integration API?

First identify whether the tool joins an existing ID family or starts a new one, then scope its IDs in the tool description, require the API key in the manager layer, and add tests covering auth failure and scoped IDs. Follow the reference implementation in the firewall ordering tools.

What is the difference between the UniFi V2 API and Integration API?

The V2 controller API uses session-cookie auth, Mongo ObjectIDs, and snake_case fields, while the Integration API uses X-API-Key auth, UUIDs, and camelCase fields. The same logical resource appears with different IDs in each API with no native bridge field.

Can I silently translate IDs between V2 and Integration APIs?

Silent ID translation is banned by default because mappings are rarely one-to-one. The only grandfathered exception is firewall zones, which are 1:1, stable, and deterministic; all other resources require an explicit named bridging tool.

Why does my Integration API tool fail with an auth error?

Integration API endpoints reject session-cookie auth and require an API key. Create a Network API token in UniFi Control Plane under Integrations and set UNIFI_API_KEY or UNIFI_NETWORK_API_KEY for the MCP server.

When should I create a bridging tool between ID namespaces?

Create a named bridging tool only when a workflow genuinely requires crossing ID namespaces, such as resolving a V2 policy ID to its Integration ordering UUID. The bridge must be a first-class tool with documented failure modes, never buried inside other tools.