Skip to main content
Glama

close_surface

Close terminal or browser panes in a multiplexer workspace to manage agent workspaces and free resources.

Instructions

Close a surface (terminal or browser pane)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
surfaceYesTarget surface ref
workspaceNoTarget workspace ref

Implementation Reference

  • src/server.ts:491-506 (registration)
    The close_surface tool is registered in src/server.ts, where it invokes client.closeSurface.
    // 9. close_surface
    server.tool(
      "close_surface",
      "Close a surface (terminal or browser pane)",
      {
        surface: z.string().describe("Target surface ref"),
        workspace: z.string().optional().describe("Target workspace ref"),
      },
      async (args) => {
        try {
          await client.closeSurface(args.surface, {
            workspace: args.workspace,
          });
          return ok({ surface: args.surface, applied: "close_surface" });
        } catch (e) {
          return err(e);
  • The actual implementation of closing a surface, which executes a cmux command.
    async closeSurface(
      surface: string,
      opts?: { workspace?: string },
    ): Promise<void> {
      const args = ["close-surface", "--surface", surface];
      if (opts?.workspace) args.push("--workspace", opts.workspace);
      await this.run(args);
    }
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. It mentions the action ('Close') but doesn't disclose behavioral traits such as whether this requires specific permissions, if the closure is reversible, what happens to unsaved data, or any side effects. 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.

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core action and resource. It uses minimal words ('Close a surface') with a clarifying parenthetical ('terminal or browser pane'), making it zero waste and easy to parse quickly.

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 performs a mutation (closing a surface) with no annotations and no output schema, the description is incomplete. It lacks information on prerequisites, effects, error conditions, or return values. For a tool that modifies state, more context is needed to guide safe and effective usage.

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 ('surface' and 'workspace') with descriptions. The description does not add any meaning beyond what the schema provides, such as explaining what a 'surface ref' entails or when 'workspace' is required. Baseline 3 is appropriate as the schema handles the 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 action ('Close') and the resource ('a surface'), specifying it can be a terminal or browser pane. It distinguishes the tool's purpose from siblings like 'list_surfaces' or 'new_split', but doesn't explicitly differentiate from 'kill' which might also terminate something, though 'close' implies a less destructive action on UI elements.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't specify if 'close_surface' should be used instead of 'kill' for surfaces, or under what conditions (e.g., after completing a task). The description only states what it does, not when or why to invoke it.

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/EtanHey/cmuxlayer'

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