Skip to main content
Glama

env_project_clear

Removes the environment association from a project, leaving it without an active environment until a new one is assigned.

Instructions

Elimina la asociación de entorno específico de un proyecto. El proyecto no tendrá entorno activo hasta que se asigne uno.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesRuta del proyecto del que eliminar la asociación

Implementation Reference

  • The handler function for 'env_project_clear' tool. It calls storage.clearProjectEnvironment(project) and returns appropriate success/error messages.
      async (params) => {
        try {
          const removed = await storage.clearProjectEnvironment(params.project)
    
          if (!removed) {
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `No hay entorno específico para el proyecto '${params.project}'`,
                },
              ],
            }
          }
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Entorno específico eliminado para proyecto '${params.project}'. Usará el entorno global.`,
              },
            ],
          }
        } catch (error) {
          const message = error instanceof Error ? error.message : String(error)
          return {
            content: [{ type: 'text' as const, text: `Error: ${message}` }],
            isError: true,
          }
        }
      },
    )
  • Input schema for 'env_project_clear': a single required string parameter 'project' describing the project path.
    {
      project: z
        .string()
        .describe('Ruta del proyecto del que eliminar la asociación'),
    },
  • Registration of the 'env_project_clear' tool using server.tool() with name, description, schema, and handler.
    server.tool(
      'env_project_clear',
      'Elimina la asociación de entorno específico de un proyecto. El proyecto no tendrá entorno activo hasta que se asigne uno.',
      {
        project: z
          .string()
          .describe('Ruta del proyecto del que eliminar la asociación'),
      },
      async (params) => {
        try {
          const removed = await storage.clearProjectEnvironment(params.project)
    
          if (!removed) {
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `No hay entorno específico para el proyecto '${params.project}'`,
                },
              ],
            }
          }
    
          return {
            content: [
              {
                type: 'text' as const,
                text: `Entorno específico eliminado para proyecto '${params.project}'. Usará el entorno global.`,
              },
            ],
          }
        } catch (error) {
          const message = error instanceof Error ? error.message : String(error)
          return {
            content: [{ type: 'text' as const, text: `Error: ${message}` }],
            isError: true,
          }
        }
      },
    )
  • The helper/storage method clearProjectEnvironment() that deletes the project-environment association from the project environments file.
    async clearProjectEnvironment(project: string): Promise<boolean> {
      const projectEnvs = await this.getProjectEnvs()
      const normalized = project.replace(/\\/g, '/')
      // Try exact match first, then normalized match
      let found = false
      for (const key of Object.keys(projectEnvs)) {
        if (key === project || key.replace(/\\/g, '/') === normalized) {
          delete projectEnvs[key]
          found = true
        }
      }
      if (!found) return false
      await this.writeJson(this.projectEnvsFile, projectEnvs)
      return true
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden. It clearly states the immediate effect of removing the association and the consequence that the project will have no active environment until one is assigned. This adds behavioral insight beyond the name, though it omits details like idempotency or error handling.

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?

Two short sentences, 22 words total, front-loaded with the key action. Every word is necessary and no redundant information. Efficient and to the point.

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 simple, one-parameter tool with no output schema, the description is fully complete: it describes the action, the consequence, and the required input. No additional context is needed for correct invocation.

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 already provides a description for the single parameter 'project'. The tool description adds no additional semantic meaning beyond what the schema states, so the baseline of 3 applies given 100% 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?

The description uses a specific verb 'Elimina' (removes) and clearly identifies the resource as the environment association of a project. It distinguishes from siblings like env_delete (removes entire environment) and env_set (assigns environment) by focusing on clearing the association, and includes a clear consequence statement.

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 does not explicitly state when to use this tool versus alternatives like env_delete or env_set. It implies usage context (clearing an association) but lacks direct comparisons or exclusion criteria, leaving the agent to infer from sibling names.

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/cocaxcode/api-testing-mcp'

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