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);
    }

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