Skip to main content
Glama

send_input

Send text input to terminal surfaces in the cmuxlayer MCP server. For reliable command execution, send text first, then use a separate send_key call for the return key.

Instructions

Send text input to a terminal surface. When sending commands to another Claude session, press_enter can be unreliable — for critical inputs, use send_input without press_enter, then call send_key with key 'return' separately.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
surfaceYesTarget surface ref
textYesText to send
workspaceNoTarget workspace ref
press_enterNoPress enter after sending text. For reliability with interactive programs, send text first, then use a separate send_key 'return' call.
rename_to_taskNoRename tab suffix to this task name

Implementation Reference

  • The handler function for the send_input tool, which sends text to a terminal, optionally presses enter, and renames a tab.
    async (args) => {
      try {
        await client.send(args.surface, args.text, {
          workspace: args.workspace,
        });
        if (args.press_enter) {
          // Small delay to let the terminal process the text input before
          // sending the return key. Without this, the enter keypress can
          // arrive before the text is fully inserted into the terminal's
          // input buffer, causing the enter to be swallowed.
          await new Promise((resolve) => setTimeout(resolve, 50));
          await client.sendKey(args.surface, "return", {
            workspace: args.workspace,
          });
        }
        if (args.rename_to_task) {
          const surfaces = await client.listPaneSurfaces({
            workspace: args.workspace,
          });
          const surface = surfaces.surfaces.find((s) => s.ref === args.surface);
          const currentTitle = surface?.title ?? "";
          const newTitle = replaceTaskSuffix(currentTitle, args.rename_to_task);
          await client.renameTab(args.surface, newTitle, {
            workspace: args.workspace,
          });
        }
        return ok({ surface: args.surface, applied: "send_input" });
      } catch (e) {
        return err(e);
      }
    },
  • src/server.ts:269-315 (registration)
    Registration of the send_input tool using the server.tool method, including its schema definition.
    // 3. send_input
    server.tool(
      "send_input",
      "Send text input to a terminal surface. When sending commands to another Claude session, press_enter can be unreliable — for critical inputs, use send_input without press_enter, then call send_key with key 'return' separately.",
      {
        surface: z.string().describe("Target surface ref"),
        text: z.string().describe("Text to send"),
        workspace: z.string().optional().describe("Target workspace ref"),
        press_enter: z
          .boolean()
          .optional()
          .default(false)
          .describe(
            "Press enter after sending text. For reliability with interactive programs, send text first, then use a separate send_key 'return' call.",
          ),
        rename_to_task: z
          .string()
          .optional()
          .describe("Rename tab suffix to this task name"),
      },
      async (args) => {
        try {
          await client.send(args.surface, args.text, {
            workspace: args.workspace,
          });
          if (args.press_enter) {
            // Small delay to let the terminal process the text input before
            // sending the return key. Without this, the enter keypress can
            // arrive before the text is fully inserted into the terminal's
            // input buffer, causing the enter to be swallowed.
            await new Promise((resolve) => setTimeout(resolve, 50));
            await client.sendKey(args.surface, "return", {
              workspace: args.workspace,
            });
          }
          if (args.rename_to_task) {
            const surfaces = await client.listPaneSurfaces({
              workspace: args.workspace,
            });
            const surface = surfaces.surfaces.find((s) => s.ref === args.surface);
            const currentTitle = surface?.title ?? "";
            const newTitle = replaceTaskSuffix(currentTitle, args.rename_to_task);
            await client.renameTab(args.surface, newTitle, {
              workspace: args.workspace,
            });
          }
          return ok({ surface: args.surface, applied: "send_input" });
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 of behavioral disclosure. It effectively explains a critical reliability consideration (press_enter unreliability) and provides a recommended workaround. However, it doesn't cover other behavioral aspects like error conditions, performance characteristics, or what happens when sending input to non-existent surfaces.

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 perfectly front-loaded with the core purpose, followed immediately by critical usage guidance. Both sentences earn their place by providing essential information without redundancy. The structure moves from general purpose to specific reliability consideration efficiently.

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

Completeness4/5

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

For a tool with 5 parameters, 100% schema coverage, and no output schema, the description provides excellent contextual completeness. It addresses the most critical behavioral consideration (press_enter reliability) that wouldn't be apparent from the schema alone. The only minor gap is lack of information about return values or error conditions.

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?

With 100% schema description coverage, the schema already documents all 5 parameters thoroughly. The description adds context about the press_enter parameter's reliability issues and recommended usage pattern, which provides valuable semantic context beyond the schema's technical documentation.

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 clearly states the specific action ('Send text input') and target resource ('to a terminal surface'), distinguishing it from sibling tools like send_key (which sends individual keys) or send_to_agent (which targets agents). It provides a precise verb+resource combination that leaves no ambiguity about the tool's function.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool versus alternatives, specifically warning that 'press_enter can be unreliable — for critical inputs, use send_input without press_enter, then call send_key with key 'return' separately.' This directly addresses a reliability concern and offers a clear alternative workflow.

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