Skip to main content
Glama

set_project_context

Define the project root directory for Scalene profiling. Use when auto-detection fails or provides an incorrect path.

Instructions

Explicitly set the project root (overrides auto-detection).

Use this if auto-detection fails or gives wrong path.

Args: project_root: Absolute path to project root

Returns: {project_root, status}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_rootYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'set_project_context' tool. It validates the provided path exists and is a directory, sets the global _project_root, and returns the project root and status.
    async def set_project_context(project_root: str) -> dict[str, str]:
        """Explicitly set the project root (overrides auto-detection).
        
        Use this if auto-detection fails or gives wrong path.
        
        Args:
            project_root: Absolute path to project root
            
        Returns: {project_root, status}
        """
        global _project_root
        path = Path(project_root)
        if not path.exists():
            raise ValueError(f"Path does not exist: {project_root}")
        if not path.is_dir():
            raise ValueError(f"Path is not a directory: {project_root}")
        
        _project_root = path
        return {
            "project_root": str(path.absolute()),
            "status": "set",
        }
  • Registration of set_project_context as a tool on the FastMCP server instance.
    server.tool(set_project_context)
Behavior3/5

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

No annotations; description mentions override behavior and returns structure, but lacks details on persistence or side effects. Adequate for simple setter.

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

Conciseness5/5

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

Very concise with purpose, usage, args, and returns. No wasted words.

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

Completeness5/5

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

For a single-parameter setter with output schema, description fully covers purpose, usage, parameter meaning, and return value.

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

Parameters4/5

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

Schema only gives type string; description adds 'absolute path' clarification, compensating for 0% schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it sets the project root, overriding auto-detection. Differentiates from sibling 'get_project_root' which reads.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says to use when auto-detection fails or gives wrong path, providing clear when-to-use context.

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

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/ptmorris05/scalene-mcp'

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