Skip to main content
Glama

get_job_output

Retrieve the complete stdout and stderr output of a job using its UUID on the MCP Background Job Server, enabling detailed process monitoring and analysis.

Instructions

Get the complete stdout and stderr output of a job.

Args: job_id: The UUID of the job to get output from

Returns: ProcessOutput containing the complete stdout and stderr content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesJob ID to get output from

Implementation Reference

  • The main handler function for the 'get_job_output' MCP tool, decorated with @mcp.tool() for registration. Delegates to JobManager service.
    @mcp.tool() async def get_job_output( job_id: str = Field(..., description="Job ID to get output from"), ) -> ProcessOutput: """Get the complete stdout and stderr output of a job. Args: job_id: The UUID of the job to get output from Returns: ProcessOutput containing the complete stdout and stderr content """ try: job_manager = get_job_manager() job_output = await job_manager.get_job_output(job_id) return job_output except KeyError: raise ToolError(f"Job {job_id} not found") except Exception as e: logger.error(f"Error getting job output for {job_id}: {e}") raise ToolError(f"Failed to get job output: {str(e)}")
  • Core implementation in JobManager class that retrieves the process output from the stored process wrapper.
    async def get_job_output(self, job_id: str) -> ProcessOutput: """Get full stdout/stderr output. Args: job_id: Job identifier Returns: ProcessOutput with complete stdout and stderr Raises: KeyError: If job_id doesn't exist """ if job_id not in self._jobs: raise KeyError(f"Job {job_id} not found") process_wrapper = self._processes.get(job_id) if process_wrapper is None: return ProcessOutput(stdout="", stderr="") return process_wrapper.get_output()
  • Pydantic model used for input validation and output typing of the get_job_output tool.
    class ProcessOutput(BaseModel): """Structured stdout/stderr output from a process.""" stdout: str = Field(..., description="Standard output content") stderr: str = Field(..., description="Standard error content")

Other Tools

Related 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/dylan-gluck/mcp-background-job'

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