Skip to main content
Glama

get_top_searches

Retrieve trending search queries from WebSim to discover popular content and community interests. Use limit and offset parameters to customize results.

Instructions

Get top search queries on WebSim

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of searches to return (default: 20)
offsetNoNumber of searches to skip (default: 0)

Input Schema (JSON Schema)

{ "properties": { "limit": { "default": 20, "description": "Number of searches to return (default: 20)", "type": "number" }, "offset": { "default": 0, "description": "Number of searches to skip (default: 0)", "type": "number" } }, "type": "object" }

Implementation Reference

  • The MCP tool handler function that executes the core logic: destructures arguments, calls the API client's getTopSearches method, and returns a formatted JSON response with the top searches data.
    handler: async (args) => { const { limit = 20, offset = 0 } = args; const result = await apiClient.getTopSearches(limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved top ${result.items?.length || 0} searches` }, null, 2) }] };
  • Input schema defining the parameters for the get_top_searches tool: optional 'limit' and 'offset' numbers with defaults of 20 and 0.
    inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of searches to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of searches to skip (default: 0)", default: 0 } } },
  • server.js:933-964 (registration)
    The complete tool definition object added to the MCP tools array, registering the get_top_searches tool with its name, description, input schema, and handler.
    { name: "get_top_searches", description: "Get top search queries on WebSim", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Number of searches to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of searches to skip (default: 0)", default: 0 } } }, handler: async (args) => { const { limit = 20, offset = 0 } = args; const result = await apiClient.getTopSearches(limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved top ${result.items?.length || 0} searches` }, null, 2) }] }; }
  • Supporting method in WebSimAPIClient class that performs the HTTP request to the WebSim API's /api/v1/search/top endpoint with pagination parameters.
    async getTopSearches(limit = 20, offset = 0) { const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() }); return this.makeRequest(`/api/v1/search/top?${params}`); }

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/gigachadtrey/websimm'

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