Skip to main content
Glama

unifi_protect_auth_login

Force a fresh UniFi Protect console login by providing a time-based one-time password (TOTP) to complete two-factor authentication and replace the cached session.

Instructions

Force a fresh login to the console, replacing any cached session. Normally unnecessary — the server logs in on demand and re-authenticates automatically on a 401. Use it to supply a two-factor code, which cannot be done unattended: the code is single-use and expires in about 30 seconds, so it is passed here once and the resulting session is then cached and reused.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
totpNoCurrent code from your authenticator app. Omit if the account has no 2FA.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only indicate non-read-only/non-idempotent/non-destructive, so the description carries the behavioral burden. It discloses session replacement, caching/reuse of the resulting session, and the critical single-use/30-second expiry nature of the 2FA code. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with the core behavior and main caveat front-loaded. Every clause adds information; no filler or repetition of schema/defaults.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-optional-parameter auth tool with no output schema, this is complete: it states what the tool does, when it is and isn't needed, the 2FA constraints, and the session lifecycle. An agent can decide correctly whether to call it and how to pass the parameter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already documents totp at 100% coverage, including the pattern and omission rule. The description adds valuable extra semantics: the code is single-use, expires in about 30 seconds, and must be passed exactly once — details the schema cannot convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action ('Force a fresh login to the console') with a clear side effect ('replacing any cached session'). Distinguishes itself from routine automatic re-authentication by explaining when this explicit login is actually needed (2FA).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Normally unnecessary' and describes the server's automatic on-demand login and 401 re-authentication as the default path. Then gives the exact condition for using this tool: supplying a two-factor code that cannot be supplied unattended.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mgcrea/mcp-unifi-protect'

If you have feedback or need assistance with the MCP directory API, please join our Discord server