Skip to main content
Glama
syndr

Ara Records MCP Server

ara_query

Query Ara API endpoints to monitor Ansible playbook executions, track task progress, and access execution data with automatic pagination defaults.

Instructions

Query Ara API endpoints with automatic pagination defaults (limit=3, order=-started)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyNoRequest body for POST requests
endpointYesAPI endpoint path (e.g., /api/v1/playbooks, /api/v1/plays/1). Supports query parameters like ?limit=10&offset=20&order=-started. If no limit is specified, defaults to 3 results.
methodNoGET

Implementation Reference

  • ara-server.js:207-229 (registration)
    Registration of the 'ara_query' tool in the getToolsList() function, including its name, description, and input schema. This list is returned by the ListToolsRequestSchema handler.
    {
      name: 'ara_query',
      description: 'Query Ara API endpoints with automatic pagination defaults (limit=3, order=-started)',
      inputSchema: {
        type: 'object',
        properties: {
          endpoint: {
            type: 'string',
            description: 'API endpoint path (e.g., /api/v1/playbooks, /api/v1/plays/1). Supports query parameters like ?limit=10&offset=20&order=-started. If no limit is specified, defaults to 3 results.',
          },
          method: {
            type: 'string',
            enum: ['GET', 'POST'],
            default: 'GET',
          },
          body: {
            type: 'object',
            description: 'Request body for POST requests',
          },
        },
        required: ['endpoint'],
      },
    },
  • Input schema definition for the 'ara_query' tool, specifying parameters like endpoint, method, and body.
    inputSchema: {
      type: 'object',
      properties: {
        endpoint: {
          type: 'string',
          description: 'API endpoint path (e.g., /api/v1/playbooks, /api/v1/plays/1). Supports query parameters like ?limit=10&offset=20&order=-started. If no limit is specified, defaults to 3 results.',
        },
        method: {
          type: 'string',
          enum: ['GET', 'POST'],
          default: 'GET',
        },
        body: {
          type: 'object',
          description: 'Request body for POST requests',
        },
      },
      required: ['endpoint'],
    },
  • Handler logic for the 'ara_query' tool within the CallToolRequestSchema request handler. Performs HTTP request to the ARA API endpoint with authentication, pagination defaults, and returns JSON response or error.
    if (name === 'ara_query') {
      const { endpoint, method = 'GET', body } = args;
    
      // Apply pagination defaults to prevent token overflow
      const paginatedEndpoint = addPaginationDefaults(endpoint);
    
      const options = {
        method,
        headers: createAuthHeaders(),
      };
    
      if (body && method === 'POST') {
        options.body = JSON.stringify(body);
      }
    
      try {
        const fullUrl = `${ARA_API_SERVER}${paginatedEndpoint}`;
        console.error(`[DEBUG] Fetching URL: ${fullUrl}`);
        console.error(`[DEBUG] Headers:`, JSON.stringify(options.headers, null, 2));
    
        const response = await fetch(fullUrl, options);
    
        console.error(`[DEBUG] Response status: ${response.status}`);
    
        if (!response.ok) {
          throw new Error(`HTTP ${response.status}: ${response.statusText} - URL: ${fullUrl}`);
        }
    
        const data = await response.json();
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(data, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error: ${error.message}`,
            },
          ],
        };
      }
    }
  • Helper function addPaginationDefaults used by ara_query to automatically add limit=3 and order=-started to API endpoints preventing token overflow.
    // Helper function to add pagination defaults to endpoints
    function addPaginationDefaults(endpoint) {
      const url = new URL(`${ARA_API_SERVER}${endpoint}`);
    
      // Add default pagination if not already present
      if (!url.searchParams.has('limit')) {
        url.searchParams.set('limit', '3');
      }
    
      // Add default ordering by most recent if not present
      if (!url.searchParams.has('order') &&
          (endpoint.includes('/playbooks') || endpoint.includes('/plays') ||
           endpoint.includes('/tasks') || endpoint.includes('/results'))) {
        url.searchParams.set('order', '-started');
      }
    
      return url.pathname + url.search;
    }
  • Helper function createAuthHeaders used by ara_query for HTTP authentication.
    function createAuthHeaders() {
      const headers = {
        'Content-Type': 'application/json',
        'User-Agent': 'ara-records-mcp/1.0',
      };
    
      // Add basic authentication if credentials are provided
      if (ARA_USERNAME && ARA_PASSWORD) {
        const credentials = Buffer.from(`${ARA_USERNAME}:${ARA_PASSWORD}`).toString('base64');
        headers['Authorization'] = `Basic ${credentials}`;
      }
    
      return headers;
    }
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 of behavioral disclosure. It adds useful context about automatic pagination defaults (limit=3, order=-started), which isn't in the schema. However, it doesn't cover other behavioral aspects like error handling, authentication needs, rate limits, or what the response looks like (no output schema). The description provides some value but leaves significant gaps for a mutation-capable 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 highly concise and front-loaded in a single sentence, with no wasted words. It efficiently communicates the core functionality and key behavioral trait (pagination defaults), earning its place without redundancy or fluff.

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?

Given the tool's complexity (3 parameters, no annotations, no output schema, supports POST/PUT mutations), the description is incomplete. It covers pagination defaults but misses critical details like mutation implications, response format, error handling, and when to use POST vs. GET. For a general-purpose API query tool with mutation capability, this leaves too many gaps for safe and effective use.

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 description adds meaningful semantics beyond the schema: it explains the automatic pagination defaults (limit=3, order=-started) for the 'endpoint' parameter, which the schema only partially covers with its example. With 67% schema description coverage, the description compensates well by clarifying default behavior, though it doesn't detail all parameters (e.g., 'body' or 'method' beyond the default).

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: 'Query Ara API endpoints' with the specific behavior of 'automatic pagination defaults (limit=3, order=-started)'. It distinguishes itself from siblings like 'get_playbook_status' and 'watch_playbook' by being a general-purpose query tool rather than focused on specific operations. However, it doesn't explicitly contrast with siblings beyond its general nature.

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 implies usage by mentioning 'automatic pagination defaults', suggesting it's for querying endpoints with pagination support. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_playbook_status' or 'watch_playbook', nor does it provide exclusions or prerequisites. The guidance is limited to implied context without clear alternatives.

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