Skip to main content
Glama

Get Role Doc

get_role_doc
Read-only

Retrieve full structured documentation for an Ansible role, including entry points, dependencies, and examples; falls back to Galaxy README parsing when local docs are empty.

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

B3.4/5.0
Behavior4/5

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

With readOnlyHint=true and openWorldHint=true already supplied, the description still adds real value: it names the three possible doc_source values ('local', 'galaxy_readme', 'unavailable'), discloses the fallback path when local ansible-doc returns empty, and states that validation failure yields {"error": str}. It does not cover auth requirements for collection_handle beyond what the schema says, but the degradation and error semantics are genuinely useful 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.

Conciseness3/5

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

The opening sentence is front-loaded and efficient, but the full enumerated 'Returns:' field list duplicates what the output schema already declares, which is wasted space under the stated convention. The fallback and error sentences do earn their place, so it is functional but not tight.

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 an output schema and annotations, the description covers the remaining gaps an agent needs: source provenance, the fallback path, conditional extra fields (doc_version, doc_warning), and the error shape. It leaves out only how this tool relates to the standalone-role and module/plugin doc siblings, which is the one notable omission.

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%, with role_name documented by example and collection_handle documented with its remote/local requirement, so the schema already carries the semantic load. The description adds nothing about parameter formatting or the session-handle lifecycle, leaving this at the baseline for fully covered schemas.

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 about what the tool returns. It does not differentiate itself from nearby siblings such as get_standalone_role_doc, get_module_doc, or get_plugin_doc, so an agent must infer that this handles full collection roles specifically.

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 guidance on when to use this versus get_standalone_role_doc or the module/plugin doc siblings, nor any stated prerequisite about the collection being present. The only conditional behavior mentioned is an internal fallback ('Falls back to Galaxy README parsing'), which describes implementation rather than usage selection.

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