Skip to main content
Glama

Parse a User-Agent into browser, OS, device and bot

user_agent
Read-only

Parses a User-Agent string: browser and version, rendering engine, operating system and version, device type, vendor and model, CPU, and whether it is a known crawler (Googlebot, Bingbot, GPTBot, ClaudeBot, PerplexityBot, AhrefsBot and a few more) with its name. Optional Client Hints values (platform, mobile, model) are reported as given. Parsed with ua-parser-js 1.x (MIT). Pure code, no outside request. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "ua": "<ua>"
    },
    "name": "user_agent"
  }
}

Input Schema

NameRequiredDescriptionDefault
uaYesThe User-Agent string, up to 1000 characters
chModelNoClient Hints model, up to 60 characters (optional)
chMobileNoClient Hints mobile flag, e.g. ?1 (optional)
chPlatformNoClient Hints platform, e.g. Windows (optional)

Output Schema

NameRequiredDescriptionDefault
osNo
cpuNo
isBotNo
deviceNo
engineNo
sourceNo
botNameNo
browserNo
platformNo
checkedAtNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the description earns credit for what it adds beyond that: the underlying library and version (ua-parser-js 1.x), the fact that no external request is made, that Client Hints are echoed 'as given' rather than normalized, the concrete bot list, and the billing model including that failed calls are free. Minor tension: 'no outside request' sits awkwardly beside openWorldHint=true and the multi-chain x402 payment, though that concerns payment rails, not the parse itself.

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?

Front-loaded with the parse scope before the operational metadata (library, no network, price). Dense but not padded; the cost sentence is long yet load-bearing for a paid tool. Slight trimming possible in the bot enumeration.

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?

An output schema exists, yet the description still names the returned categories, which is more than sufficient. For a single-string parser, library provenance, offline behavior, payment terms and failure billing together cover everything an agent needs to invoke it correctly.

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% and all four parameters are documented with length limits, so the baseline is 3. The description adds genuine semantics beyond the schema by explaining that the three Client Hints fields are passed through verbatim rather than parsed or validated, which tells an agent how those inputs will surface in the result.

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 precise verb and resource ('Parses a User-Agent string') and then enumerates exactly what it extracts: browser+version, engine, OS+version, device type/vendor/model, CPU, bot detection with name. That level of output specificity lets an agent distinguish it from neighbours like ai_crawlers or github_user without opening either schema.

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?

The input contract (a UA string, optionally plus Client Hints) implies when the tool applies, but there is no explicit when-to-use/when-not statement and no named alternative — notably ai_crawlers, which an agent might otherwise prefer for pure bot-identification queries. Usage is inferable rather than guided.

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