Skip to main content
Glama

Analizar User-Agent

user-agent-parse
Read-onlyIdempotent

Analiza heurísticamente un User-Agent: navegador, motor, sistema operativo, tipo de dispositivo y bots conocidos. Puede ser falsificado. Cuándo: hay que leer, construir o revisar con exactitud una URL, una cabecera HTTP, un token, una versión, un rango de IP, un documento HTML o Markdown o un archivo para agentes. No para: analizar una cabecera Accept-Language y elegir el mejor idioma (accept-language-parse). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Heuristically parses a User-Agent string into browser and version, engine, OS and version, device class (desktop/mobile/tablet/bot) and known crawlers/AI bots. User-Agents can be spoofed. When: a URL, HTTP header, token, version string, IP range, HTML or Markdown document or agent-readiness file has to be parsed, built or checked exactly. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
user_agentYesUser-Agent header (string; required; up to 2048 chars).

Output Schema

NameRequiredDescriptionDefault
osNo
botNo
deviceNo
engineNo
browserNo
os_versionNo
browser_versionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / user_agent / examples
      Added value: +[
      +  "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Heuristically parses a User-Agent string into browser and version, engine, OS and version, device class (desktop/mobile/tablet/bot) and known crawlers/AI bots. User-Agents can be spoofed. When: a URL, HTTP header, token, version string, IP range, HTML or Markdown document or agent-readiness file has to be parsed, built or checked exactly. Not for: parsing an Accept-Language header and picking the best locale (accept-language-parse). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, non-open-world, idempotent and non-destructive, so the description's 'sin red, sin estado guardado' is largely restatement. It earns credit for going beyond them: 'heurísticamente' plus 'Puede ser falsificado' warns the result is best-effort and spoofable, and the concrete limits (64 KB input, 1 s per call, 1 MB result) are operationally useful facts an agent cannot get from annotations.

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

Conciseness3/5

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

Core purpose is front-loaded, which is good, but the text is duplicated wholesale in Spanish and English and padded with a boilerplate sentence listing unrelated artefact types (tokens, IP ranges, HTML files) that do not describe this tool. Roughly half the content is redundancy or noise rather than scope.

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 only one required parameter and an output schema present, the description need not explain return values, and it does supply the missing operational context: determinism, spoofing caveat, time/size limits and an explicit sibling exclusion. It falls short only because the misleading 'Cuándo' list and the bilingual duplication add ambiguity rather than completeness.

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?

The single parameter is fully covered by the schema (type, required, maxLength 2048, an example UA, and its own description), so the schema does the heavy lifting. The description adds no per-parameter detail such as accepted input forms or the interaction between the 2048-char field cap and the 64 KB payload cap.

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 ('Analiza heurísticamente un User-Agent') and enumerates the exact extracted fields: browser+version, engine, OS, device class and known bots. That is enough for an agent to tell it apart from neighbours like accept-language-parse or http-headers-parse without opening a schema.

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

Usage Guidelines4/5

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

Provides an explicit negative routing rule: 'No para: analizar una cabecera Accept-Language ... (accept-language-parse)', which names the closest sibling and the condition that selects it. The positive 'Cuándo' clause, however, is generic boilerplate ('una URL, una cabecera HTTP, un token, ... un documento HTML o Markdown') that could wrongly suggest the tool parses URLs or documents, so the guidance is clear on exclusion but noisy on inclusion.

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