Skip to main content
Glama
IPGeolocation

IP Geolocation MCP Server

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
NameRequiredDescriptionDefault
uaStringsYesArray of user-agent strings to parse. Minimum 1, maximum 1,000 in this MCP server.
force_refreshNoDefault false. Leave unset unless the user asks to refresh or rerun.

Implementation Reference

  • 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);
          }
        }
      );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IPGeolocation/ipgeolocation-io-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server