Skip to main content
Glama
UserB1ank

interactive-process-mcp

by UserB1ank

send_input

Send text input to a running interactive process by providing the session ID and text, with an option to append a newline character.

Instructions

Send text input to a running interactive process.

Args: session_id: The session ID returned by start_process. text: Text to send to the process stdin. press_enter: Whether to append a newline after the text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
textYes
press_enterNo

Implementation Reference

  • MCP tool handler for 'send_input': retrieves session and delegates to Session.send_input()
    @mcp.tool()
    def send_input(
        session_id: str,
        text: str,
        press_enter: bool = False,
    ) -> dict:
        """Send text input to a running interactive process.
    
        Args:
            session_id: The session ID returned by start_process.
            text: Text to send to the process stdin.
            press_enter: Whether to append a newline after the text.
        """
        session = _mgr.get(session_id)
        if not session:
            return {"error": f"Session '{session_id}' not found"}
        try:
            session.send_input(text, press_enter=press_enter)
            return {"success": True}
        except RuntimeError as e:
            return {"error": str(e)}
  • Alternative handler for 'send_input' in the tools-based registration (used via create_tools())
    def send_input(args: dict) -> dict:
        session = _get_session(args["session_id"])
        session.send_input(args["text"], press_enter=args.get("press_enter", False))
        return {"success": True}
  • Type-annotated parameters acting as schema/validation for send_input (session_id, text, press_enter)
    def send_input(
        session_id: str,
        text: str,
        press_enter: bool = False,
  • Session.send_input(): core implementation that writes text to the process stdin (via pexpect for pty or subprocess.PIPE for pipe mode)
    def send_input(self, text: str, press_enter: bool = False) -> None:
        if self.status != SessionStatus.RUNNING:
            raise RuntimeError(f"Process has {self.status.value}, cannot send input")
        if press_enter:
            text += os.linesep
        if self.mode == "pty":
            self._process.send(text)
        else:
            self._process.stdin.write(text.encode("utf-8"))
            self._process.stdin.flush()
  • Registration of 'send_input' in the create_tools() tuple-list returned by tools.py
    return [
        ("start_process", start_process),
        ("send_input", send_input),
Behavior3/5

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

With no annotations, the description takes full burden; it explains parameters but lacks disclosure of side effects, error conditions, or whether input is buffered. The behavior of text sending is adequately described but not comprehensively.

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 concise with a one-line purpose statement followed by parameter details. No unnecessary words, and the most critical information is front-loaded.

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?

Given sibling tools for process management, the description is sufficient for basic use. However, it omits return value information and potential errors, which would be helpful but not required since no output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage; the description adds meaning for all three parameters: session_id origin, text content, and press_enter effect (appending newline). This fully compensates for the schema gap.

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 action ('Send text input to a running interactive process'), specifying the verb and resource, and distinguishes from sibling tools like start_process and read_output.

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 implies usage context by referencing session_id from start_process, but does not explicitly state when to use versus alternatives like send_and_read, nor provides when-not-to-use guidance.

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/UserB1ank/interactive-process-mcp'

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