Skip to main content
Glama

UniFi Protect: Auth Login

unifi_protect_auth_login

Forces a fresh UniFi Protect console login to replace a cached session and accepts a one-time 2FA/TOTP code, then caches the authenticated session for reuse.

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

NameRequiredDescriptionDefault
totpNoCurrent code from your authenticator app. Omit if the account has no 2FA.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say it is a non-idempotent, non-destructive write; the description goes further by disclosing that this replaces a cached session, that the resulting session is cached and reused, and that the code is single-use with roughly 30 seconds of validity. That is exactly the operational context an agent needs to avoid burning a code on a retry.

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 tight sentences, front-loaded with the action and its side effect, then the caveat, then the one legitimate use case. No filler and nothing repeated from the schema.

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

Completeness4/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 annotations and no output schema, the description covers when to call it, what the code is, and how the session is cached. Only the error path (what an invalid or expired code does to the existing session) is left unstated.

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?

Schema coverage is 100% so the totp field is already documented, but the description adds real meaning the schema cannot express: the code is single-use, expires in about 30 seconds, and is passed once. It stops short of describing failure behavior for an invalid or expired code.

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 verb and resource ('Force a fresh login to the console') plus the exact effect ('replacing any cached session'), which cleanly separates it from the sibling auth_status and auth_logout tools.

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 it is 'Normally unnecessary' because the server logs in on demand and re-authenticates on a 401, then names the one condition that justifies calling it: supplying a two-factor code unattended. That is a clear when/when-not pair with the default alternative spelled out.

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