Skip to main content
Glama
jbroll

MCP Build Environment Service

by jbroll

env

Display environment variables and build tool versions for software projects. Optionally isolate configurations by Git branch using worktrees.

Instructions

Show environment information including environment variables and versions of key build tools (gcc, g++, python, make, cmake, etc.). If branch is specified, creates/uses a hidden worktree (.repo@branch) for isolation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesRepository name (required)
branchNoGit branch name (optional). If provided, uses isolated worktree.

Implementation Reference

  • The main handler function for the 'env' tool. It retrieves the repo and optional branch from input arguments, checks for the existence of the env_info.sh script, and executes it within the specified repository's worktree using the shared execute_in_worktree method.
    async def handle_env(self, args: Dict[str, Any]) -> List[TextContent]:
        """Handle env command"""
        repo = args.get("repo")
        branch = args.get("branch")
    
        # Execute env info script
        if not ENV_INFO_SCRIPT.exists():
            raise FileNotFoundError(f"Environment info script not found: {ENV_INFO_SCRIPT}")
    
        # Execute in appropriate worktree with locking
        result = await self.execute_in_worktree(repo, branch, [str(ENV_INFO_SCRIPT)])
        return [TextContent(type="text", text=result)]
  • Pydantic-like JSON schema definition for the 'env' tool's input parameters in the tool registry returned by get_tools_list().
    Tool(
        name="env",
        description="Show environment information including environment variables "
                   "and versions of key build tools (gcc, g++, python, make, cmake, etc.). "
                   "If branch is specified, creates/uses a hidden worktree (.repo@branch) for isolation.",
        inputSchema={
            "type": "object",
            "properties": {
                "repo": {
                    "type": "string",
                    "description": "Repository name (required)"
                },
                "branch": {
                    "type": "string",
                    "description": "Git branch name (optional). If provided, uses isolated worktree."
                }
            },
            "required": ["repo"]
        }
    ),
  • src/server.py:461-462 (registration)
    Dispatch registration within the central execute_tool handler that routes 'env' tool calls to the specific handle_env function.
    elif name == "env":
        return await self.handle_env(arguments)
Behavior3/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. It discloses behavioral traits: it shows information (implying read-only, non-destructive), and specifies that with a branch parameter, it uses isolated worktree creation. However, it doesn't cover aspects like rate limits, authentication needs, error handling, or output format details, leaving gaps for a tool with mutation potential (worktree creation).

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 with two sentences: the first states the core purpose, and the second explains the branch parameter's effect. It's front-loaded with the main functionality. However, the second sentence could be slightly more concise, and there's minor redundancy in listing build tools.

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

Completeness3/5

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

Given no annotations and no output schema, the description is moderately complete. It covers the purpose and a key behavioral aspect (worktree isolation), but lacks details on output format, error conditions, or full behavioral context for a tool that involves potential mutation (worktree creation). For a tool with 2 parameters and no structured output, it should provide more guidance on what information is returned.

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?

Schema description coverage is 100%, so the schema already documents both parameters (repo and branch). The description adds marginal value by explaining the branch parameter's effect ('creates/uses a hidden worktree for isolation'), but doesn't provide additional semantics beyond what the schema offers for 'repo'. Baseline 3 is appropriate as the schema handles most parameter documentation.

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: 'Show environment information including environment variables and versions of key build tools (gcc, g++, python, make, cmake, etc.)'. It specifies the verb 'show' and the resources (environment info, build tool versions). However, it doesn't explicitly differentiate from sibling tools like 'list' or 'git', which could have overlapping functionality.

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

Usage Guidelines3/5

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

The description provides implied usage guidance: it mentions that if a branch is specified, it creates/uses a hidden worktree for isolation. This suggests when to use the branch parameter. However, it doesn't explicitly state when to use this tool versus alternatives like 'list' or 'git', nor does it provide exclusions or prerequisites beyond the optional branch parameter.

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/jbroll/mcp-build'

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