Skip to main content
Glama

switch_repository

Switch between initialized code repositories by specifying the target path. Facilitates seamless navigation and analysis of Python code dependencies within the Nuanced MCP Server.

Instructions

Switch to a different initialized repository.

Args: repo_path: Path to the repository to switch to

Returns: Success message or error

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYes

Implementation Reference

  • The main handler function for the 'switch_repository' MCP tool. It switches the active repository by setting the global _active_repo to the absolute path of the provided repo_path, after verifying it exists in the initialized _code_graphs dictionary. Includes docstring serving as input/output schema and is registered as a tool via the @mcp.tool() decorator.
    @mcp.tool() def switch_repository(repo_path: str) -> str: """Switch to a different initialized repository. Args: repo_path: Path to the repository to switch to Returns: Success message or error """ global _code_graphs, _active_repo abs_path = os.path.abspath(repo_path) if abs_path not in _code_graphs: return f"Error: Repository at '{repo_path}' has not been initialized. Use initialize_graph first." _active_repo = abs_path return f"Successfully switched to repository: {repo_path}"

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mattmorgis/nuanced-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server