Skip to main content
Glama
syndr

Ara Records MCP Server

get_playbook_status

Check Ansible playbook execution status to monitor completion and track multiple playbooks using the Ara Records API.

Instructions

Get a quick summary of playbook execution status without detailed task information. Useful for checking if a playbook is complete or monitoring multiple playbooks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
playbook_idYesThe ID of the playbook to check

Implementation Reference

  • Specific handler logic for the 'get_playbook_status' tool. Fetches playbook details without tasks or results and returns a concise status summary including progress, timing, and path.
    if (name === 'get_playbook_status') {
      const { playbook_id } = args;
    
      try {
        const details = await fetchPlaybookDetails(playbook_id, false, false);
    
        // Return just the summary without task details
        const status = {
          id: details.id,
          status: details.status,
          progress: details.progress,
          started: details.started,
          ended: details.ended,
          duration: details.duration,
          path: details.path,
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(status, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error checking playbook ${playbook_id} status: ${error.message}`,
            },
          ],
        };
      }
    }
  • Input schema for the 'get_playbook_status' tool, defining the required 'playbook_id' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        playbook_id: {
          type: 'number',
          description: 'The ID of the playbook to check',
        },
      },
      required: ['playbook_id'],
    },
  • ara-server.js:254-267 (registration)
    Registration of the 'get_playbook_status' tool in the list returned by ListToolsRequestHandler, including name, description, and input schema.
    {
      name: 'get_playbook_status',
      description: 'Get a quick summary of playbook execution status without detailed task information. Useful for checking if a playbook is complete or monitoring multiple playbooks.',
      inputSchema: {
        type: 'object',
        properties: {
          playbook_id: {
            type: 'number',
            description: 'The ID of the playbook to check',
          },
        },
        required: ['playbook_id'],
      },
    },
  • Helper function fetchPlaybookDetails used by 'get_playbook_status' (and 'watch_playbook') to retrieve and summarize playbook data from the ARA API, with optional task and result details.
    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 that this is a read operation ('Get') and specifies the output scope ('quick summary' vs 'detailed task information'), but doesn't mention behavioral aspects like error handling, performance characteristics, or what 'quick summary' entails. It adds some context but lacks comprehensive behavioral disclosure.

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 two sentences that each serve a distinct purpose: the first states the tool's function and scope, the second provides usage scenarios. There's zero wasted language, and it's front-loaded with the core purpose.

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 single-parameter read tool with no annotations and no output schema, the description provides adequate context about what the tool does and when to use it. However, it doesn't describe what the 'quick summary' output contains or how it differs from what sibling tools might provide, leaving some gaps in completeness.

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 documents the single parameter 'playbook_id' with its description. The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score of 3 when schema coverage is high.

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: 'Get a quick summary of playbook execution status without detailed task information.' It specifies the verb ('Get'), resource ('playbook execution status'), and scope ('quick summary' vs 'detailed task information'), but doesn't explicitly differentiate from sibling tools like 'ara_query' or 'watch_playbook'.

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 when to use this tool: 'Useful for checking if a playbook is complete or monitoring multiple playbooks.' This gives practical scenarios, though it doesn't explicitly state when NOT to use it or name alternatives among the sibling tools.

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