get_docs2prompt_docs
Retrieves documentation from a specified GitHub repository to generate prompts for LLMs.
Instructions
Use this tool to get the documentation from a GitHub repository.
Args:
github_repo: The GitHub repository to get the documentation for.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| github_repo | Yes |
Implementation Reference
- src/main.py:7-25 (handler)The handler function for the 'get_docs2prompt_docs' tool. It extracts the owner/repo from a GitHub URL or accepts a direct 'owner/repo' string, calls get_github_documentation from the docs2prompt library, and returns the result truncated to 10000 characters.
@mcp.tool() async def get_docs2prompt_docs(github_repo: str): """ Use this tool to get the documentation from a GitHub repository. Args: github_repo: The GitHub repository to get the documentation for. """ if "github.com/" in github_repo: parts = github_repo.split("github.com/")[1].split("/") github_repo = f"{parts[0]}/{parts[1]}" github_token = os.getenv("GITHUB_TOKEN", None) result = get_github_documentation(github_repo, github_token) # Limit for longest possible response needs to be explored # Asking for https://github.com/browser-use/browser-use seems to crash the server return result[:10000] if result else result - src/main.py:8-14 (schema)The tool definition and input schema: the @mcp.tool() decorator registers the tool, and the function signature defines the only required parameter 'github_repo' as a string.
async def get_docs2prompt_docs(github_repo: str): """ Use this tool to get the documentation from a GitHub repository. Args: github_repo: The GitHub repository to get the documentation for. """ - src/main.py:7-7 (registration)Registration of the tool via the @mcp.tool() decorator on the FastMCP instance.
@mcp.tool()