Skip to main content
Glama
debugg-ai

Debugg AI MCP

Official
by debugg-ai

Search Workflow Executions

search_executions

Retrieve workflow execution records by UUID for full detail or filter by status, project, and pagination for summaries.

Instructions

Search or look up workflow executions (history of check_app_in_browser, trigger_crawl, and other workflow runs).

Two modes:

  • uuid mode: {"uuid": ""} → single execution with FULL detail including nodeExecutions, state, errorInfo. NotFound if the uuid doesn't exist.

  • filter mode: {"status": "completed"|"running"|"failed"|"cancelled", "projectUuid": "...", "page", "pageSize"} → paginated summaries.

Response shape: {filter, pageInfo, executions[]}. Summary items have outcome/status/durationMs/timestamps; uuid-mode items additionally have nodeExecutions + state + errorInfo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidNoExecution UUID. Returns single execution with full detail. Mutually exclusive with projectUuid/status filters.
projectUuidNoFilter by project UUID.
statusNoFilter by status: completed | running | failed | cancelled | pending.
pageNoPage number (1-indexed).
pageSizeNoPage size (1..200). Default 20.

Implementation Reference

  • Main handler for the search_executions tool. Two modes: uuid mode (single execution with full detail + screenshot/GIF embedding) and filter mode (paginated list of executions). Uses DebuggAIServerClient to call the backend API.
    export async function searchExecutionsHandler(
      input: SearchExecutionsInput,
      _context: ToolContext,
    ): Promise<ToolResponse> {
      const start = Date.now();
      logger.toolStart('search_executions', input);
    
      try {
        const client = new DebuggAIServerClient(config.api.key);
        await client.init();
    
        if (input.uuid) {
          try {
            const execution = await client.workflows!.getExecution(input.uuid);
            const payload = {
              filter: { uuid: input.uuid },
              pageInfo: { page: 1, pageSize: 1, totalCount: 1, totalPages: 1, hasMore: false },
              executions: [execution],
            };
            logger.toolComplete('search_executions', Date.now() - start);
    
            const content: ToolResponse['content'] = [
              { type: 'text', text: JSON.stringify(payload, null, 2) },
            ];
    
            const SCREENSHOT_URL_KEYS = ['finalScreenshot', 'screenshot', 'screenshotUrl', 'screenshotUri'];
            const GIF_KEYS = ['runGif', 'gifUrl', 'gif', 'videoUrl', 'recordingUrl'];
            const nodes: any[] = execution.nodeExecutions ?? [];
            const subworkflowNode = nodes.find((n: any) => n.nodeType === 'subworkflow.run');
    
            let screenshotEmbedded = false;
            let screenshotUrl: string | null = null;
            let gifUrl: string | null = null;
    
            const screenshotB64 = subworkflowNode?.outputData?.screenshotB64;
            if (typeof screenshotB64 === 'string' && screenshotB64) {
              content.push(imageContentBlock(screenshotB64, 'image/png'));
              screenshotEmbedded = true;
            }
    
            for (const node of nodes) {
              const data = node.outputData ?? {};
              if (!screenshotEmbedded && !screenshotUrl) {
                for (const key of SCREENSHOT_URL_KEYS) {
                  if (typeof data[key] === 'string' && data[key]) {
                    screenshotUrl = data[key] as string;
                    break;
                  }
                }
              }
              if (!gifUrl) {
                for (const key of GIF_KEYS) {
                  if (typeof data[key] === 'string' && data[key]) {
                    gifUrl = data[key] as string;
                    break;
                  }
                }
              }
              if ((screenshotEmbedded || screenshotUrl) && gifUrl) break;
            }
    
            if (!screenshotEmbedded && screenshotUrl) {
              const img = await fetchImageAsBase64(screenshotUrl).catch(() => null);
              if (img) content.push(imageContentBlock(img.data, img.mimeType));
            }
            if (gifUrl) {
              const gif = await fetchImageAsBase64(gifUrl).catch(() => null);
              if (gif) content.push(imageContentBlock(gif.data, 'image/gif'));
            }
    
            return { content };
          } catch (err: any) {
            if (err?.statusCode === 404 || err?.response?.status === 404) return notFound(input.uuid);
            throw err;
          }
        }
    
        const pagination = toPaginationParams({ page: input.page, pageSize: input.pageSize });
        const { pageInfo, executions } = await client.workflows!.listExecutions({
          status: input.status,
          projectId: input.projectUuid,
          page: pagination.page,
          pageSize: pagination.pageSize,
        });
    
        const payload = {
          filter: {
            status: input.status ?? null,
            projectUuid: input.projectUuid ?? null,
          },
          pageInfo,
          executions,
        };
        logger.toolComplete('search_executions', Date.now() - start);
        return { content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }] };
      } catch (error) {
        logger.toolError('search_executions', error as Error, Date.now() - start);
        throw handleExternalServiceError(error, 'DebuggAI', 'search_executions');
      }
    }
  • Zod schema and TypeScript type for search_executions input. uuid is mutually exclusive with projectUuid/status. Supports optional page/pageSize for pagination.
    export const SearchExecutionsInputSchema = z.object({
      uuid: z.string().uuid().optional(),
      projectUuid: z.string().uuid().optional(),
      status: z.string().min(1).optional(),
      page: z.number().int().min(1).optional(),
      pageSize: z.number().int().min(1).optional(),
    }).strict().refine(
      (v) => !(v.uuid && (v.projectUuid || v.status)),
      { message: 'Cannot combine uuid with filter params (projectUuid, status).' },
    );
    export type SearchExecutionsInput = z.infer<typeof SearchExecutionsInputSchema>;
  • Builds the MCP Tool definition for search_executions with name, title, description, and raw JSON input schema.
    export function buildSearchExecutionsTool(): Tool {
      return {
        name: 'search_executions',
        title: 'Search Workflow Executions',
        description: DESCRIPTION,
        inputSchema: {
          type: 'object',
          properties: {
            uuid: { type: 'string', description: 'Execution UUID. Returns single execution with full detail. Mutually exclusive with projectUuid/status filters.' },
            projectUuid: { type: 'string', description: 'Filter by project UUID.' },
            status: { type: 'string', description: 'Filter by status: completed | running | failed | cancelled | pending.' },
            page: { type: 'number', description: 'Page number (1-indexed).' },
            pageSize: { type: 'number', description: 'Page size (1..200). Default 20.' },
          },
          additionalProperties: false,
        },
      };
    }
  • Wraps the tool definition with Zod validation schema and the handler function, creating a ValidatedTool.
    export function buildValidatedSearchExecutionsTool(): ValidatedTool {
      const tool = buildSearchExecutionsTool();
      return { ...tool, inputSchema: SearchExecutionsInputSchema, handler: searchExecutionsHandler };
    }
  • tools/index.ts:57-85 (registration)
    Registration of search_executions in the central tool registry. buildValidatedSearchExecutionsTool() is called in initTools() and the resulting ValidatedTool is stored in toolRegistry keyed by name.
      const validated: ValidatedTool[] = [
        buildValidatedTestPageChangesTool(ctx),
        buildValidatedTriggerCrawlTool(ctx),
        buildValidatedProbePageTool(),
        buildValidatedSearchProjectsTool(),
        buildValidatedSearchEnvironmentsTool(),
        buildValidatedCreateEnvironmentTool(),
        buildValidatedUpdateEnvironmentTool(),
        buildValidatedDeleteEnvironmentTool(),
        buildValidatedUpdateProjectTool(),
        buildValidatedDeleteProjectTool(),
        buildValidatedSearchExecutionsTool(),
        buildValidatedCreateProjectTool(),
        buildValidatedCreateTestSuiteTool(),
        buildValidatedSearchTestSuitesTool(),
        buildValidatedDeleteTestSuiteTool(),
        buildValidatedCreateTestCaseTool(),
        buildValidatedUpdateTestCaseTool(),
        buildValidatedDeleteTestCaseTool(),
        buildValidatedRunTestSuiteTool(),
        buildValidatedGetTestSuiteResultsTool(),
      ];
    
      _tools = tools;
      _validatedTools = validated;
    
      toolRegistry.clear();
      for (const v of validated) toolRegistry.set(v.name, v);
    }
Behavior4/5

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

With no annotations, the description fully discloses behavior: two operation modes, response shapes (summaries vs full detail), pagination details, NotFound handling, and the set of fields returned. It implies read-only operation, which is consistent with the tool's purpose. No contradictions with annotations.

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

Conciseness4/5

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

The description is well-structured with a clear introductory sentence, then bullet points for two modes. It provides necessary detail without being verbose. Every sentence adds value, though a slightly more concise opening could be achieved.

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?

Given no output schema and no annotations, the description provides sufficient context: it explains the response shapes and behaviors for both modes, including error handling (NotFound). It does not cover authentication or rate limits, but these are often implied for server tools. Overall, it is adequate for an agent to use the tool correctly.

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?

While the input schema already provides 100% coverage with descriptions, the description adds meaning by explaining the mutual exclusivity between uuid and other filters, the exact response shapes per mode, and the meaning of the 'status' parameter values. This goes beyond the schema to guide correct invocation.

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: searching or looking up workflow executions. It specifies the two distinct modes (uuid and filter) and what each returns, and distinguishes it from sibling tools like check_app_in_browser and trigger_crawl by clarifying it returns their execution history.

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

Usage Guidelines4/5

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

The description explicitly outlines two modes and when to use each (single execution vs paginated list). While it doesn't explicitly say when not to use it or mention alternatives for initiating executions, the context is clear that this is for retrieval only, which is adequate for an agent to decide.

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/debugg-ai/debugg-ai-mcp'

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