Skip to main content
Glama
syndr

Ara Records MCP Server

watch_playbook

Monitor Ansible playbook execution progress in real-time to track task completion, current status, and execution timeline with detailed progress updates.

Instructions

Monitor a playbook execution in real-time. Returns detailed progress including task completion, current status, and execution timeline. Call repeatedly to track progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_resultsNoInclude task result details (default: false, can be verbose)
include_tasksNoInclude detailed task information (default: true)
playbook_idYesThe ID of the playbook to monitor

Implementation Reference

  • ara-server.js:230-253 (registration)
    Registration of the 'watch_playbook' tool in getToolsList(), including name, description, and input schema.
    {
      name: 'watch_playbook',
      description: 'Monitor a playbook execution in real-time. Returns detailed progress including task completion, current status, and execution timeline. Call repeatedly to track progress.',
      inputSchema: {
        type: 'object',
        properties: {
          playbook_id: {
            type: 'number',
            description: 'The ID of the playbook to monitor',
          },
          include_tasks: {
            type: 'boolean',
            description: 'Include detailed task information (default: true)',
            default: true,
          },
          include_results: {
            type: 'boolean',
            description: 'Include task result details (default: false, can be verbose)',
            default: false,
          },
        },
        required: ['playbook_id'],
      },
    },
  • Input schema definition for the watch_playbook tool.
    inputSchema: {
      type: 'object',
      properties: {
        playbook_id: {
          type: 'number',
          description: 'The ID of the playbook to monitor',
        },
        include_tasks: {
          type: 'boolean',
          description: 'Include detailed task information (default: true)',
          default: true,
        },
        include_results: {
          type: 'boolean',
          description: 'Include task result details (default: false, can be verbose)',
          default: false,
        },
      },
      required: ['playbook_id'],
    },
  • Handler logic for executing the watch_playbook tool within the CallToolRequestSchema request handler. Extracts parameters and calls the fetchPlaybookDetails helper.
    if (name === 'watch_playbook') {
      const { playbook_id, include_tasks = true, include_results = false } = args;
    
      try {
        const details = await fetchPlaybookDetails(playbook_id, include_tasks, include_results);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(details, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error monitoring playbook ${playbook_id}: ${error.message}`,
            },
          ],
        };
      }
    }
  • Core helper function that implements the logic for fetching playbook details, progress calculation, and optional task/result data retrieval used by watch_playbook.
    async function fetchPlaybookDetails(playbookId, includeTasks = true, includeResults = false) {
      try {
        // Fetch playbook data
        const playbookResponse = await fetch(`${ARA_API_SERVER}${API_PATH}/playbooks/${playbookId}`, {
          headers: createAuthHeaders(),
        });
    
        if (!playbookResponse.ok) {
          throw new Error(`HTTP ${playbookResponse.status}: ${playbookResponse.statusText}`);
        }
    
        const playbook = await playbookResponse.json();
    
        // Calculate progress
        const totalTasks = playbook.items.tasks || 0;
        const totalResults = playbook.items.results || 0;
        const progressPercent = totalTasks > 0 ? Math.round((totalResults / totalTasks) * 100) : 0;
    
        const summary = {
          id: playbook.id,
          status: playbook.status,
          path: playbook.path,
          started: playbook.started,
          ended: playbook.ended,
          duration: playbook.duration,
          ansible_version: playbook.ansible_version,
          controller: playbook.controller,
          user: playbook.user,
          progress: {
            percent: progressPercent,
            tasks_total: totalTasks,
            tasks_completed: totalResults,
            plays: playbook.items.plays,
            hosts: playbook.items.hosts,
          },
          labels: playbook.labels,
        };
    
        // Optionally fetch task details
        if (includeTasks) {
          const tasksResponse = await fetch(
            `${ARA_API_SERVER}${API_PATH}/tasks?playbook=${playbookId}&limit=100&order=started`,
            {
              headers: createAuthHeaders(),
            }
          );
    
          if (tasksResponse.ok) {
            const tasksData = await tasksResponse.json();
            summary.tasks = tasksData.results.map(task => ({
              id: task.id,
              name: task.name,
              status: task.status,
              action: task.action,
              started: task.started,
              ended: task.ended,
              duration: task.duration,
              tags: task.tags,
            }));
            summary.tasks_count = tasksData.count;
          }
        }
    
        // Optionally fetch result details
        if (includeResults) {
          const resultsResponse = await fetch(
            `${ARA_API_SERVER}${API_PATH}/results?playbook=${playbookId}&limit=100&order=started`,
            {
              headers: createAuthHeaders(),
            }
          );
    
          if (resultsResponse.ok) {
            const resultsData = await resultsResponse.json();
            summary.results = resultsData.results.map(result => ({
              id: result.id,
              task: result.task,
              host: result.host,
              status: result.status,
              changed: result.changed,
              started: result.started,
              ended: result.ended,
              duration: result.duration,
            }));
            summary.results_count = resultsData.count;
          }
        }
    
        return summary;
      } catch (error) {
        throw new Error(`Failed to fetch playbook details: ${error.message}`);
      }
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: real-time monitoring, repeated calling requirement, and that it returns progress details. However, it doesn't mention potential side effects, authentication needs, rate limits, or error conditions that would be important for a monitoring tool.

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 with three sentences that each earn their place: states the purpose, describes the return value, and provides crucial usage guidance. It's front-loaded with the core functionality and wastes no words.

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 monitoring tool with no annotations and no output schema, the description provides adequate basic information about what the tool does and how to use it. However, it lacks details about the return format structure, error handling, and the implications of 'real-time' monitoring that would be needed for full contextual understanding.

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 schema already documents all three parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline for high schema coverage without compensating with additional semantic context.

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 with specific verbs ('Monitor', 'Returns', 'Call repeatedly') and identifies the resource ('playbook execution'). It distinguishes from siblings by focusing on real-time monitoring rather than querying (ara_query) or getting a single status snapshot (get_playbook_status).

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 provides clear context for usage ('Call repeatedly to track progress'), indicating this is for ongoing monitoring rather than one-time status checks. However, it doesn't explicitly state when NOT to use this tool or directly compare it to the sibling tools (ara_query, get_playbook_status).

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/syndr/ara-records-mcp'

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