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

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

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}`);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states what the tool does, not how it behaves. It doesn't mention whether this is a read-only operation, if it requires authentication, rate limits, what format the results come in, or any other behavioral characteristics.

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

Conciseness5/5

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

The description is a single, clear sentence with no wasted words. It's appropriately sized for a simple retrieval tool and gets straight to the point without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'top search queries' means (by what metric? over what timeframe?), what the return format looks like, or any behavioral constraints. The agent would be left guessing about important operational details.

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?

With 100% schema description coverage, the input schema already fully documents both parameters (limit and offset). The description adds no additional parameter information beyond what's in the schema, so it meets the baseline but doesn't provide extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'top search queries on WebSim', making the purpose immediately understandable. However, it doesn't differentiate from siblings like 'get_trending_feed' or 'search_assets' which might also involve search-related data retrieval.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'search_assets', 'search_feed', and 'get_trending_feed' that might overlap in functionality, there's no indication of what makes this tool distinct or when it's the appropriate choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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