Skip to main content
Glama
Negm-Ahmed

Desktop Commander

by Negm-Ahmed

interact_with_process

Execute code within a running process for local data analysis. Use it to run Python, R, or Node.js to read, process, and analyze files.

Instructions

                    Send input to a running process and automatically receive the response.
                    
                    CRITICAL: THIS IS THE PRIMARY TOOL FOR ALL LOCAL FILE ANALYSIS
                    For ANY local file analysis (CSV, JSON, data processing), ALWAYS use this instead of the analysis tool.
                    The analysis tool CANNOT access local files and WILL FAIL - use processes for ALL file-based work.
                    
                    FILE ANALYSIS PRIORITY ORDER (MANDATORY):
                    1. ALWAYS FIRST: Use this tool (start_process + interact_with_process) for local data analysis
                    2. ALTERNATIVE: Use command-line tools (cut, awk, grep) for quick processing  
                    3. NEVER EVER: Use analysis tool for local file access (IT WILL FAIL)
                    
                    REQUIRED INTERACTIVE WORKFLOW FOR FILE ANALYSIS:
                    1. Start REPL: start_process("python3 -i")
                    2. Load libraries: interact_with_process(pid, "import pandas as pd, numpy as np")
                    3. Read file: interact_with_process(pid, "df = pd.read_csv('/absolute/path/file.csv')")
                    4. Analyze: interact_with_process(pid, "print(df.describe())")
                    5. Continue: interact_with_process(pid, "df.groupby('column').size()")
                    
                    SMART DETECTION:
                    - Automatically waits for REPL prompt (>>>, >, etc.)
                    - Detects errors and completion states
                    - Early exit prevents timeout delays
                    - Clean output formatting (removes prompts)
                    
                    SUPPORTED REPLs:
                    - Python: python3 -i (RECOMMENDED for data analysis)
                    - Node.js: node -i  
                    - R: R
                    - Julia: julia
                    - Shell: bash, zsh
                    - Database: mysql, postgres
                    
                    PARAMETERS:
                    - pid: Process ID from start_process
                    - input: Code/command to execute
                    - timeout_ms: Max wait (default: 8000ms)
                    - wait_for_prompt: Auto-wait for response (default: true)
                    
                    Returns execution result with status indicators.
                    
                    ALWAYS USE FOR: CSV analysis, JSON processing, file statistics, data visualization prep, ANY local file work
                    NEVER USE ANALYSIS TOOL FOR: Local file access (it cannot read files from disk and WILL FAIL)
                    
                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

NameRequiredDescriptionDefault
pidYes
inputYes
timeout_msNo
wait_for_promptNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.3

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It usefully discloses prompt-waiting, error detection, early exit, output cleanup, and parameter defaults, but it omits the security and destructive implications of executing arbitrary code in a live process as well as process lifecycle risks.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

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

The description is heavily repetitive, with multiple all-caps warnings restating the same file-analysis rule. Important workflow information is present but buried in redundant sections, so many sentences do not earn their place.

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

Completeness3/5

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

The description supplies a workflow and parameter defaults for a tool with no annotations and no output schema. However, it omits process lifecycle details, expected failure modes, and security warnings, and it does not explain how this tool relates to read_process_output or other process-management siblings.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It does list all four parameters and adds meaning beyond the schema, including that pid comes from start_process, that input is code/command text, and the defaults for timeout_ms and wait_for_prompt.

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 opening sentence states a specific verb and resource: 'Send input to a running process and automatically receive the response.' It also names start_process in the workflow, though it does not clearly differentiate from siblings like read_process_output. The core purpose is clear despite heavy tangential file-analysis guidance.

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

Usage Guidelines4/5

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

The description gives explicit usage direction, including a priority order and the instruction to use start_process + interact_with_process for local file analysis. It names alternatives such as command-line tools and the analysis tool, but the guidance is overbroad and does not mention the sibling read_process_output.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.