Documentation Access Tools
Relevant source files
The following files were used as context for generating this wiki page:
Documentation Access Tools provide Large Language Models (LLMs) and developers with live access to Stacklet’s official user documentation. The system exposes tools to browse available documentation files and read their contents in Markdown format, enabling the agent to maintain up-to-date context on platform features, governance policies, and Infrastructure as Code (IaC) practices.
These tools serve as the primary knowledge base for the MCP server. They cover the core Stacklet platform as well as IaC Governance (also known as Sinistral). Sources: CLAUDE.md:19-23, stacklet/mcp/mcp_info.md:43-48
System Architecture
The documentation system functions as a client that fetches content from a live Stacklet deployment's documentation service. It derives the documentation endpoint dynamically from the platform configuration.
Connectivity and Service Discovery
The MCP server derives the documentation service URL by replacing the api. prefix with docs. in the configured platform endpoint. For example, if the platform API is at https://api.example.com, the documentation service resides at https://https://docs.example.com. Sources: CLAUDE.md:200-202
The system relies on three core components:
- Documentation Client: Manages HTTP requests to the documentation service and handles authentication.
- Tool Implementations: Exposes the
docs_listanddocs_readfunctions to the MCP interface. - Data Models: Defines the Pydantic structures for documentation metadata and file contents.
Sources: CLAUDE.md:31-35
Data Flow for Documentation Retrieval
This diagram illustrates the process of an LLM requesting and receiving documentation through the MCP server.
The documentation listing is cached across requests to improve performance and reduce network overhead. Sources: tests/test_tools_docs.py:59-74
Tool Reference
The documentation package provides two primary tools. Both tools are marked with the readOnlyHint and openWorldHint annotations to inform the host that they do not modify state and access external data. Sources: tests/test_tools_docs.py:23-31
Documentation Tools Summary
| Tool Name | Action | Key Parameters | Return Data |
|---|---|---|---|
docs_list | Lists all available user documentation files. | None | base_url, available_document_files, recommended_start |
docs_read | Retrieves the content of a specific document. | file_path | path, content |
Sources: CLAUDE.md:95-97, tests/test_tools_docs.py:48-57
docs_list
This tool retrieves the index.json file from the documentation service. It returns a recommended starting point, typically index_llms.md, which is optimized for AI assistance. Sources: tests/test_tools_docs.py:55, stacklet/mcp/mcp_info.md:52
docs_read
This tool fetches the Markdown text for a specific file path. If a requested path is missing from the index, the tool returns a specific error message prompting the agent to call docs_list to find valid paths. Sources: tests/test_tools_docs.py:79-99
Content Scope
The Documentation Access Tools provide context for various Stacklet modules that do not have dedicated MCP tools for management or scanning.
IaC Governance (Sinistral)
IaC Governance (Sinistral) does not have its own specific MCP tools for scanning Terraform or managing shift-left policies. Instead, all information regarding Sinistral API, policy sources, and scan results is accessed via documentation tools. Documentation for this product is found under the iac/ directory, starting with iac/index.md. Sources: stacklet/mcp/mcp_info.md:27-41
Platform API Guidance
While the platform has GraphQL tools, comprehensive guidance for administrative mutations and entity guidelines (like "Account Discovery" or "Notification Setup") is retrieved through docs_read. Relevant files often start with the how-to/api/ path. Sources: stacklet/mcp/platform/graphql_info.md:67-75
Usage Best Practices
To effectively use the documentation system, follow these patterns:
- Start with the Index: Always call
docs_listfirst to understand the structure of the current deployment's documentation. Sources: stacklet/mcp/mcp_info.md:8 - Use LLM-Optimized Docs: Prefer files like
index_llms.mdfor high-level summaries. Sources: stacklet/mcp/mcp_info.md:52 - Cross-Reference Glossaries: Before reasoning across different modules (e.g., AssetDB vs. Sinistral), read
reference/glossary.mdto identify overlapping vocabulary with different meanings. Sources: stacklet/mcp/mcp_info.md:33-35 - Error Recovery: If a
docs_readcall fails with a 404, check the documentation index again, as the deployment might be running an older version of the docs than the agent expects. Sources: tests/test_tools_docs.py:101-118
Documentation Access Tools ensure that the MCP server operates with the most recent platform knowledge, bridging the gap between static tool definitions and the evolving Stacklet ecosystem. Summary based on: README.md:9-11, stacklet/mcp/mcp_info.md:43-55