Skip to main content
Glama

list_searches

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;

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