Skip to main content
Glama

User agent parser

hopi_user_agent_parser
Read-onlyIdempotent

Parse a user agent string into its parts: browser and version, rendering engine, operating system and version, device type (mobile, tablet or desktop) and whether it looks like a bot or crawler. Uses an ordered pattern table (Edge before Chrome, Chrome before Safari). Frozen tokens are handled: Safari on iOS 26 and later reports iOS 18_7, so the version comes from its Version token; macOS 10.15.7 and Chrome's "Android 10; K" are reported as "or later". User agent strings can be spoofed, so results are best-effort, not proof. Source: https://hopi.co.uk/user-agent-parser/

Input Schema

NameRequiredDescriptionDefault
uaYesThe user agent string to parse

Output Schema

NameRequiredDescriptionDefault
osYes
botYes
deviceYes
engineYes
browserYes
summaryYes
source_urlYesThe tool's page on hopi.co.uk (cite or open to check the figure)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / required
      Added value: +[
      +  "bot",
      +  "browser",
      +  "device",
      +  "engine",
      +  "os",
      +  "source_url",
      +  "summary"
      +]
  2. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), yet the description still adds real behavioural context: an ordered pattern table with precedence (Edge before Chrome, Chrome before Safari), frozen-token handling for iOS 26/macOS 10.15.7/Android 'K', and an explicit best-effort caveat about spoofing. That is exactly the kind of interpretation guidance an agent needs to trust and frame the output.

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

Conciseness4/5

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

Purpose and output list are front-loaded, then edge-case handling, then the trust caveat — a sensible order with no filler. It runs long for a single-parameter tool, but each sentence (pattern ordering, frozen tokens, spoofability) conveys something an agent would otherwise have to guess.

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?

With an output schema present, the description needn't explain return values, and it covers input, precedence behaviour, edge cases, and reliability limits. The only gap is failure behaviour for malformed or empty input, which the minLength constraint implies but the description never addresses.

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

Parameters3/5

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

Schema coverage is 100% and there is only one parameter ('ua'), so the schema already carries the semantics. The description implies the input is a raw UA string but adds no format, length, or example guidance beyond that, so the baseline 3 applies.

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?

The first sentence gives a specific verb (parse) plus the resource (user agent string) and enumerates exactly what parts come back: browser/version, engine, OS/version, device type, bot flag. That level of output enumeration makes it instantly distinguishable from neighbours like hopi_url_parser or hopi_cron_expression_parser.

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

Usage Guidelines3/5

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

Usage is implied by the enumerated outputs — an agent can infer 'call this when you need to know the browser/OS/device behind a UA string' — and the spoofing caveat tells it the result is advisory. But there is no explicit when-to-use statement, no prerequisites, and no named alternative in the large sibling list, so the routing burden stays with the agent.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources