Skip to main content
Glama

Get Role Doc

get_role_doc
Read-only

Retrieves full structured documentation for one Ansible role, including entry points, dependencies, and examples; falls back to Galaxy README when local ansible-doc returns no content.

Instructions

Get full structured documentation for one role.

Returns: role_name, content_type ('role'), short_description, doc_source ('local', 'galaxy_readme', or 'unavailable'), entry_points (dict of entry point names to {description, options}), dependencies (list), examples (str). When doc_source is 'galaxy_readme', also includes doc_version and doc_warning. Falls back to Galaxy README parsing if local ansible-doc returns empty. On validation failure returns {"error": str}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "role_name": "<role_name>"
    },
    "name": "get_role_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
role_nameYesFully-qualified role name (e.g. 'fedora.linux_system_roles.timesync')
collection_handleNoSession handle returned by ensure_collection. Omit on local stdio; required on remote.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.0
    • addedInput schema / properties / collection_handle
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Session handle returned by ensure_collection. Omit on local stdio; required on remote."
      +}
  2. First observedv0.7.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, and the description adds real behavioral context beyond that: the fallback to Galaxy README parsing when local ansible-doc is empty, the conditional doc_version/doc_warning fields, and the {'error': str} shape on validation failure. That is substantive disclosure of failure and degradation modes for a read 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?

Front-loaded with a one-line purpose, then a compact structured list of return fields and edge cases. Every sentence carries information; nothing is filler.

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?

The tool is simple (2 params, output schema present, annotations present) and the description covers purpose, fallback behavior, and error semantics thoroughly. The one real gap is sibling differentiation against get_standalone_role_doc, which keeps it short of a 5.

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 both role_name (fully-qualified format) and collection_handle (required on remote, omit on stdio) are already documented in the schema. The description adds nothing about either parameter, so the baseline 3 applies.

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?

States a specific verb and resource ('Get full structured documentation for one role'), which is unambiguous. However, it never distinguishes itself from the sibling 'get_standalone_role_doc', so an agent must guess which role-doc tool to pick.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use guidance, and no mention of when to prefer this over get_standalone_role_doc, get_collection_docs, or fetch_doc. The only context is the implicit 'you need a role's docs', which leaves routing decisions to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.