Skip to main content
Glama
nanoseil

MCP Background Task Server

by nanoseil

Get Task Stderr

get-task-stderr

Retrieve stderr output from a running background task to monitor errors and debug processes in MCP server environments.

Instructions

Retrieves the stderr of a running background task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesUnique name of the task

Implementation Reference

  • Handler function that fetches the stderr output from the Child process instance for the given task name and returns it in the tool response format.
    async ({ name }) => {
      const child = processes.get(name);
      if (!child) {
        return {
          content: [
            {
              type: "text",
              text: `No task found with name "${name}".`,
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: "text",
            text: `Stderr of task "${name}":\n${
              child.stderr || "No error output yet."
            }`,
          },
        ],
      };
    }
  • Schema definition for the get-task-stderr tool, including title, description, and input schema requiring a task name.
    {
      title: "Get Task Stderr",
      description: "Retrieves the stderr of a running background task.",
      inputSchema: {
        name: z.string().describe("Unique name of the task"),
      },
    },
  • src/index.ts:216-249 (registration)
    Registration of the get-task-stderr tool with the MCP server, including schema and handler.
    server.registerTool(
      "get-task-stderr",
      {
        title: "Get Task Stderr",
        description: "Retrieves the stderr of a running background task.",
        inputSchema: {
          name: z.string().describe("Unique name of the task"),
        },
      },
      async ({ name }) => {
        const child = processes.get(name);
        if (!child) {
          return {
            content: [
              {
                type: "text",
                text: `No task found with name "${name}".`,
              },
            ],
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: `Stderr of task "${name}":\n${
                child.stderr || "No error output yet."
              }`,
            },
          ],
        };
      }
    );
  • Event listener that accumulates stderr output from the child process into the Child instance's stderr property.
    child.stderr?.on("data", (data) => {
      this.stderr += data.toString();
    });
  • Getter method for accessing the accumulated stderr of a Child process instance.
    public getStderr(): string {
      return this.stderr;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool retrieves stderr, implying a read operation, but lacks details on permissions, rate limits, error handling, or what happens if the task isn't running. This leaves significant gaps for a tool interacting with background tasks.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the tool's moderate complexity (interacting with background tasks), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, error cases, or return format, leaving room for improvement in completeness.

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?

The input schema has 100% coverage, fully documenting the 'name' parameter as a unique task identifier. The description adds no additional semantic context beyond implying the task must be running, which is minimal value. Baseline 3 is appropriate since the schema does the heavy lifting.

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 description clearly states the verb ('retrieves') and resource ('stderr of a running background task'), making the purpose immediately understandable. It distinguishes from sibling tools like 'get-task-stdout' by specifying stderr, but doesn't explicitly contrast with other siblings like 'list-background-tasks' or 'stop-background-task'.

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?

The description provides minimal guidance, stating it retrieves stderr for 'a running background task', which implies it should be used when a task is active. However, it offers no explicit when-not-to-use advice, prerequisites, or alternatives among siblings like 'get-task-stdout' for stdout or 'list-background-tasks' for task status.

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/nanoseil/mcp-bgtask'

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