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}"
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool switches repositories and returns a success/error message, but lacks details on side effects (e.g., whether this affects other operations), permissions needed, or error conditions. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

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

The description is appropriately sized and front-loaded, with the core purpose stated first. The 'Args' and 'Returns' sections add structure, though they could be more integrated. There's no wasted text, but the lack of detailed guidance slightly reduces efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation with no annotations, 1 parameter at 0% schema coverage, and no output schema), the description is incomplete. It doesn't cover behavioral traits, parameter details, or usage context, making it inadequate for safe and effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It adds minimal value: it names the parameter ('repo_path') and states it's a 'Path to the repository to switch to,' but doesn't explain format (e.g., absolute vs. relative), examples, or constraints. This is insufficient given the low coverage.

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?

The description clearly states the tool's purpose: 'Switch to a different initialized repository.' This specifies the verb ('switch') and resource ('initialized repository'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'list_repositories' or 'initialize_graph,' which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., that repositories must be initialized first), exclusions, or comparisons with siblings like 'list_repositories' for checking available repos. This leaves the agent without context for proper tool selection.

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

Install Server

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