Skip to main content
Glama

list_searches

Read-only

View active searches to monitor their IDs, types, patterns, status, and runtime. Manage multiple concurrent searches by tracking their progress and details.

Instructions

                    List all active searches.
                    
                    Shows search IDs, search types, patterns, status, and runtime.
                    Similar to list_sessions for terminal processes. Useful for managing
                    multiple concurrent searches.
                    
                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the list_searches tool. Lists all active search sessions managed by searchManager, formats a readable output with session details including ID, type, pattern, status, runtime, and result count. Returns formatted text or error if failed.
    export async function handleListSearches(): Promise<ServerResult> {
      try {
        const sessions = searchManager.listSearchSessions();
        
        if (sessions.length === 0) {
          return {
            content: [{ type: "text", text: "No active searches." }],
          };
        }
    
        let output = `Active Searches (${sessions.length}):\n\n`;
        
        for (const session of sessions) {
          const status = session.isComplete 
            ? (session.isError ? '❌ ERROR' : '✅ COMPLETED')
            : '🔄 RUNNING';
          
          output += `Session: ${session.id}\n`;
          output += `  Type: ${session.searchType}\n`;
          output += `  Pattern: "${session.pattern}"\n`;
          output += `  Status: ${status}\n`;
          output += `  Runtime: ${Math.round(session.runtime / 1000)}s\n`;
          output += `  Results: ${session.totalResults}\n\n`;
        }
    
        return {
          content: [{ type: "text", text: output }],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        
        return {
          content: [{ type: "text", text: `Error listing search sessions: ${errorMessage}` }],
          isError: true,
        };
      }
    }
  • Zod schema definition for list_searches tool arguments. Empty object schema since the tool requires no input parameters.
    export const ListSearchesArgsSchema = z.object({});
  • src/server.ts:631-645 (registration)
    MCP tool registration in list_tools handler: defines name 'list_searches', description, input schema (empty), and annotations. This makes the tool discoverable to MCP clients.
        name: "list_searches",
        description: `
                List all active searches.
                
                Shows search IDs, search types, patterns, status, and runtime.
                Similar to list_sessions for terminal processes. Useful for managing
                multiple concurrent searches.
                
                ${CMD_PREFIX_DESCRIPTION}`,
        inputSchema: zodToJsonSchema(ListSearchesArgsSchema),
        annotations: {
            title: "List Active Searches",
            readOnlyHint: true,
        },
    },
  • Handler dispatch registration in call_tool request handler: maps tool name 'list_searches' to execution of handleListSearches function from handlers module.
    case "list_searches":
        result = await handlers.handleListSearches();
        break;
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the agent knows this is a safe read operation. The description adds useful context about what information is returned (search IDs, types, patterns, status, runtime) and the management use case, but doesn't disclose behavioral traits like pagination, rate limits, or authentication requirements beyond what annotations provide.

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

Conciseness3/5

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

The description is reasonably concise with 4 sentences, but includes unnecessary marketing language: 'This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.' This doesn't add value for AI agent tool selection and could be removed. The core information is front-loaded but diluted by the final sentence.

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

Completeness3/5

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

For a read-only listing tool with no parameters and no output schema, the description provides adequate context about what information is returned and the management use case. However, it doesn't explain the return format structure or any limitations (like maximum results), which would be helpful given the absence of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of parameters. The description appropriately doesn't discuss parameters, maintaining focus on the tool's purpose and output. Baseline for 0 parameters with full schema coverage is 4.

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 tool's purpose: 'List all active searches' with specific details about what information is shown (IDs, types, patterns, status, runtime). It distinguishes from siblings by mentioning 'Similar to list_sessions for terminal processes', though it doesn't explicitly differentiate from all similar listing tools like list_directory or list_processes.

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 provides implied usage context: 'Useful for managing multiple concurrent searches' and references sibling tool list_sessions. However, it doesn't explicitly state when to use this tool versus alternatives like get_more_search_results or stop_search, nor does it provide clear exclusions or prerequisites.

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/wonderwhy-er/ClaudeComputerCommander'

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