bulk_parse_user_agent
Parse multiple user-agent strings in bulk to extract device, browser, and OS details for up to 1,000 strings per request.
Instructions
Bulk user-agent parsing via POST /v3/user-agent-bulk for up to 1,000 strings per MCP request. Paid only. Cost: 1 credit per string.
Use this tool for multiple user-agent strings. For a single string, use parse_user_agent.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uaStrings | Yes | Array of user-agent strings to parse. Minimum 1, maximum 1,000 in this MCP server. | |
| force_refresh | No | Default false. Leave unset unless the user asks to refresh or rerun. |
Implementation Reference
- src/tools/useragent.ts:65-110 (handler)Registration and handler implementation for bulk_parse_user_agent tool. It uses parseUserAgentBulk from client.js and includes caching logic.
server.registerTool( "bulk_parse_user_agent", { title: "Bulk User-Agent Parser", annotations: { readOnlyHint: true, }, description: `Bulk user-agent parsing via POST /v3/user-agent-bulk for up to ${MAX_BULK_ITEMS.toLocaleString()} strings per MCP request. Paid only. Cost: 1 credit per string. Use this tool for multiple user-agent strings. For a single string, use parse_user_agent.`, inputSchema: { uaStrings: z .array(z.string()) .min(1) .max(MAX_BULK_ITEMS) .describe( `Array of user-agent strings to parse. Minimum 1, maximum ${MAX_BULK_ITEMS.toLocaleString()} in this MCP server.` ), force_refresh: z .boolean() .optional() .describe("Default false. Leave unset unless the user asks to refresh or rerun."), }, }, async (params) => { try { const cacheKey = buildUserAgentBulkCacheKey(params.uaStrings); const cached = params.force_refresh ? undefined : getCachedValue(cacheKey); const result = cached ?? (await parseUserAgentBulk({ uaStrings: params.uaStrings, })); if (cached === undefined) { setCachedValue(cacheKey, result); } return { content: [ { type: "text" as const, text: formatToolResult(result) }, ], }; } catch (error) { return errorToolResponse(error); } } );