Skip to main content
Glama

local_dev_run_tests

Run automated tests in a local development sandbox to validate code functionality and detect issues during development.

Instructions

Auto-detect and run tests in a local development environment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
env_idYesEnvironment identifier

Implementation Reference

  • Tool handler logic: retrieves environment by ID, calls run_environment_tests, formats response with success, summary, and coverage.
    elif name == "local_dev_run_tests":
        env = get_environment(arguments["env_id"])
        if not env:
            return [
                types.TextContent(
                    type="text",
                    text=json.dumps(
                        {
                            "success": False,
                            "error": f"Unknown environment: {arguments['env_id']}",
                        }
                    ),
                )
            ]
        result = await run_environment_tests(env)
        response = {
            "success": result["success"],
            "summary": result["summary"],
        }
        if result.get("coverage"):
            response["coverage"] = {
                "lines": result["coverage"].lines,
                "statements": result["coverage"].statements,
                "branches": result["coverage"].branches,
                "functions": result["coverage"].functions,
                "files": result["coverage"].files
            }
        return [types.TextContent(type="text", text=json.dumps(response))]
  • Tool schema definition including input schema requiring 'env_id'.
    types.Tool(
        name="local_dev_run_tests",
        description="Auto-detect and run tests in a local development environment",
        inputSchema={
            "type": "object",
            "properties": {
                "env_id": {"type": "string", "description": "Environment identifier"}
            },
            "required": ["env_id"],
        },
    ),
  • Helper function that invokes the test detection and running logic, with error handling.
    async def run_environment_tests(env: Environment) -> Dict[str, Any]:
        """Run tests in environment."""
    
        try:
            return await detect_and_run_tests(env)
        except Exception as e:
            return {"success": False, "error": str(e)}
  • Core helper that detects available test runners (pytest, jest, etc.), selects first, and executes tests.
    async def detect_and_run_tests(env: Environment) -> Dict[str, Any]:
        """Auto-detect and run tests in environment."""
    
        runners = await detect_runners(env)
        if not runners:
            return {"success": False, "error": "No test runners detected"}
    
        config = RunConfig(runner=runners[0], env=env, test_dirs=[env.sandbox.work_dir])
        result = await execute_runner(config)
    
        return result
  • Registration of tools list via MCP server decorator, which includes the local_dev_run_tests tool.
    @server.list_tools()
    async def list_tools() -> List[types.Tool]:
        logger.debug("Tools requested")
        return tools
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 mentions 'auto-detect and run tests' but lacks details on permissions, side effects, error handling, or output format. This is inadequate for a tool that likely involves execution in a development environment.

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?

The description is a single, efficient sentence that is front-loaded and contains no wasted words. It directly conveys the core functionality without unnecessary elaboration.

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 lack of annotations and output schema, and the tool's potential complexity (running tests in a local environment), the description is insufficient. It does not cover behavioral aspects, return values, or error cases, leaving significant gaps for the agent.

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

Parameters3/5

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

The input schema has 100% description coverage, with the 'env_id' parameter documented as 'Environment identifier'. The description does not add any further meaning or context about this parameter, so it meets the baseline for high schema coverage without extra value.

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 with a specific verb ('run tests') and resource ('in a local development environment'), and includes the 'auto-detect' capability. However, it does not explicitly differentiate from sibling tools like local_dev_cleanup or local_dev_from_github, 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, such as the sibling tools listed. There is no mention of prerequisites, context, or exclusions, leaving the agent with minimal usage direction.

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/txbm/mcp-local-dev'

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