update_documentation
Update and rebuild the Pydantic AI documentation search index by cloning the repository and parsing documentation files.
Instructions
Clones/updates the Pydantic repo, parses docs, and rebuilds the search index.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force_clone | No |
Implementation Reference
- pydantic_ai_docs_server/server.py:32-59 (handler)The implementation of the `update_documentation` tool, which orchestrates cloning/updating the repository and returning a status response.
@app.tool() async def update_documentation(force_clone: bool = False) -> StatusResponse: """Clones/updates the Pydantic repo, parses docs, and rebuilds the search index.""" logger.info(f"update_documentation called with force_clone={force_clone}") try: repo_update_result = clone_or_pull_repository(force_clone) logger.info(f"Repository update result: {repo_update_result}") if repo_update_result.get("status") == "error": return StatusResponse( status="error", message=repo_update_result.get("message", "Repository update failed"), data=repo_update_result, ) commit_hash = get_current_commit_hash() return StatusResponse( status="success", message=f"Documentation updated successfully from commit {commit_hash}.", data={"commit_hash": commit_hash}, ) except Exception as e: logger.error(f"Error in update_documentation: {e}", exc_info=True) return StatusResponse( status="error", message=str(e), data={"error_details": str(e)} )