Skip to main content
Glama

list_searches

Retrieve a paginated history of similarity search queries with timestamps and result counts from your account.

Instructions

List previous similarity searches performed on your account. Returns a paginated list of past search queries with timestamps and result counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoPagination cursor from a previous response
limitNoResults per page (1-100, default: 20)

Implementation Reference

  • Main implementation of list_searches tool. Contains the tool registration, input schema definition (cursor and limit parameters), and the handler logic that makes an API call to /api/v1/search with pagination support.
    export function register(server: McpServer, api: ApiClient): void {
      server.tool(
        "list_searches",
        "List previous similarity searches performed on your account. " +
          "Returns a paginated list of past search queries with timestamps and result counts.",
        {
          cursor: z
            .string()
            .optional()
            .describe("Pagination cursor from a previous response"),
          limit: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Results per page (1-100, default: 20)"),
        },
        async (params) => {
          try {
            const result = await api.get("/api/v1/search", {
              cursor: params.cursor,
              limit: params.limit?.toString(),
            });
            return {
              content: [
                { type: "text" as const, text: JSON.stringify(result, null, 2) },
              ],
            };
          } catch (err) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: `Error: ${err instanceof Error ? err.message : String(err)}`,
                },
              ],
              isError: true as const,
            };
          }
        },
      );
  • Zod schema definition for list_searches tool parameters. Defines optional 'cursor' (pagination token) and 'limit' (1-100, default 20) parameters with validation.
      cursor: z
        .string()
        .optional()
        .describe("Pagination cursor from a previous response"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Results per page (1-100, default: 20)"),
    },
  • src/index.ts:11-11 (registration)
    Import statement for listSearches function from ./tools/list-searches.js
    import { register as listSearches } from "./tools/list-searches.js";
  • src/index.ts:51-51 (registration)
    Registration of list_searches tool by calling listSearches(server, api) in the server initialization
    listSearches(server, api);
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it returns 'a paginated list' (important for handling large result sets), specifies what data is included ('past search queries with timestamps and result counts'), and implies read-only behavior through 'List' and 'Returns'. It doesn't mention rate limits, authentication needs, or data retention policies, but provides solid core behavioral information.

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 perfectly concise and well-structured: two sentences that efficiently convey purpose, scope, and key behavioral characteristics. Every word earns its place, with no redundancy or unnecessary elaboration.

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?

For a read-only list tool with 2 parameters and 100% schema coverage but no output schema, the description provides good contextual completeness. It explains what's returned (past search queries with timestamps and result counts) and that results are paginated, which compensates for the lack of output schema. It could potentially mention authentication scope or data freshness, but covers the essentials well.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters (cursor for pagination, limit for results per page). The description adds no additional parameter information beyond what's in the schema, but doesn't need to since schema coverage is complete. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description clearly states the tool's purpose: 'List previous similarity searches performed on your account' - a specific verb ('List') and resource ('previous similarity searches'). It distinguishes from siblings like 'search_media' (which performs searches) by focusing on historical search queries rather than executing new searches.

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

Usage Guidelines3/5

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

The description implies usage context through 'previous similarity searches' and 'past search queries', suggesting this is for retrieving history rather than performing operations. However, it doesn't explicitly state when to use this versus alternatives like 'search_media' or provide any exclusion criteria.

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/sidearmDRM/mcp-server'

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