Skip to main content
Glama
FutureAtoms

Agentic Control Framework (ACF)

by FutureAtoms

read_output

Retrieve session output by providing a process ID to access its logged data.

Instructions

Read session output

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYes

Implementation Reference

  • The actual implementation of read_output: finds a session by PID, collects its output/error buffers, clears them, and returns the results with session metadata.
    function readOutput(pid) {
      try {
        // Find session by PID
        let session = null;
        for (const [id, s] of sessions) {
          if (s.pid === pid) {
            session = s;
            break;
          }
        }
    
        if (!session) {
          return {
            success: false,
            message: `No session found with PID ${pid}`
          };
        }
    
        const output = session.output.join('');
        const error = session.error.join('');
    
        // Clear read output
        session.output = [];
        session.error = [];
    
        return {
          success: true,
          pid,
          sessionId: session.id,
          status: session.status,
          output,
          error,
          exitCode: session.exitCode,
          duration: session.endTime ? session.endTime - session.startTime : Date.now() - session.startTime
        };
    
      } catch (error) {
        logger.error(`Error reading output: ${error.message}`);
        return {
          success: false,
          message: error.message
        };
      }
    }
  • Tool registration/definition in the tools list: name 'read_output', description 'Read session output', input schema requiring a 'pid' number.
      { name:'read_output', description:'Read session output', inputSchema:{ type:'object', properties:{ pid:{type:'number'} }, required:['pid'] } },
      { name:'force_terminate', description:'Force terminate', inputSchema:{ type:'object', properties:{ pid:{type:'number'} }, required:['pid'] } },
      { name:'list_sessions', description:'List sessions', inputSchema:{ type:'object', properties:{ random_string:{type:'string'} }, required:['random_string'] } },
      { name:'list_processes', description:'List processes', inputSchema:{ type:'object', properties:{ random_string:{type:'string'} }, required:['random_string'] } },
      { name:'kill_process', description:'Kill process', inputSchema:{ type:'object', properties:{ pid:{type:'number'} }, required:['pid'] } },
      // Search & Edit
      { name:'search_code', description:'Search code', inputSchema:{ type:'object', properties:{ path:{type:'string'}, pattern:{type:'string'}, ignoreCase:{type:'boolean'}, includeHidden:{type:'boolean'}, contextLines:{type:'number'}, maxResults:{type:'number'}, timeoutMs:{type:'number'} }, required:['path','pattern'] } },
      { name:'edit_block', description:'Edit block', inputSchema:{ type:'object', properties:{ file_path:{type:'string'}, old_string:{type:'string'}, new_string:{type:'string'}, expected_replacements:{type:'number'}, normalize_whitespace:{type:'boolean'} }, required:['file_path','old_string','new_string'] } },
      // Enhanced FS
      { name:'read_url', description:'Read URL', inputSchema:{ type:'object', properties:{ path:{type:'string'}, timeout:{type:'number'} }, required:['path'] } },
      // Watcher
      { name:'start_file_watcher', description:'Start file watcher', inputSchema:{ type:'object', properties:{ debounceDelay:{type:'number'} } } },
      { name:'stop_file_watcher', description:'Stop file watcher', inputSchema:{ type:'object', properties:{} } },
      { name:'file_watcher_status', description:'File watcher status', inputSchema:{ type:'object', properties:{} } },
      { name:'force_sync', description:'Force sync task files', inputSchema:{ type:'object', properties:{} } },
      // Priority ops
      { name:'bump_task_priority', description:'Bump task priority', inputSchema:{ type:'object', properties:{ id:{type:'string'}, amount:{type:'number'} }, required:['id'] } },
      { name:'defer_task_priority', description:'Defer task priority', inputSchema:{ type:'object', properties:{ id:{type:'string'}, amount:{type:'number'} }, required:['id'] } },
      { name:'prioritize_task', description:'Set high priority', inputSchema:{ type:'object', properties:{ id:{type:'string'}, priority:{type:'number'} }, required:['id'] } },
      { name:'deprioritize_task', description:'Set low priority', inputSchema:{ type:'object', properties:{ id:{type:'string'}, priority:{type:'number'} }, required:['id'] } },
      // Algorithm config
      { name:'configure_time_decay', description:'Configure time decay', inputSchema:{ type:'object', properties:{ enabled:{type:'boolean'}, halfLifeDays:{type:'number'} } } },
      { name:'configure_effort_weighting', description:'Configure effort weighting', inputSchema:{ type:'object', properties:{ enabled:{type:'boolean'}, weight:{type:'number'} } } },
      { name:'show_algorithm_config', description:'Show algorithm config', inputSchema:{ type:'object', properties:{} } },
      // Browser & AppleScript
      { name:'browser_navigate', description:'Navigate URL', inputSchema:{ type:'object', properties:{ url:{type:'string'} }, required:['url'] } },
      { name:'applescript_execute', description:'Run AppleScript (macOS)', inputSchema:{ type:'object', properties:{ code_snippet:{type:'string'}, timeout:{type:'number'} }, required:['code_snippet'] } }
    ];
  • Dispatch case in tools/call handler that routes 'read_output' to terminalTools.readOutput(args.pid).
    case 'read_output': data = terminalTools.readOutput(args.pid); break;
  • Export of readOutput from the terminal_tools module.
    module.exports = {
      getConfig,
      setConfigValue,
      executeCommand,
      readOutput,
      forceTerminate,
      listSessions,
      listProcesses,
      killProcess
    };
  • Test helper that provides default args for read_output in example generation.
    case 'read_output': return { pid: 0 }; // replaced dynamically
Behavior2/5

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

No annotations are present, so the description bears full responsibility. It only states the action without disclosing behavioral traits such as side effects (none expected), permission requirements, or error handling. The agent cannot determine if this is a safe read operation.

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

Conciseness3/5

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

The description is very concise at two words, but this brevity sacrifices clarity. It is not verbose, but it is under-informative. A slightly longer description would improve effectiveness without losing conciseness.

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 no output schema and a single opaque parameter, the description is insufficient for an agent to use this tool correctly. It does not specify return format, error conditions, or relation to other tools, making it incomplete.

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

Parameters2/5

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

The schema has one parameter 'pid' with no description. The tool description does not explain how 'pid' relates to 'session output' or what values it expects. With 0% schema description coverage, the description should compensate but fails to add any semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Read session output', which provides a verb and a noun indicating the action and resource. However, it is vague and does not clarify what 'session output' refers to (e.g., process stdout, terminal output, or something else). It does not distinguish from sibling tools like 'read_file' or 'list_sessions'.

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 guidelines are provided regarding when to use this tool over alternatives. There is no mention of prerequisites, context, or exclusions, leaving the agent without decision support.

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/FutureAtoms/agentic-control-framework'

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