Skip to main content
Glama
network-terminal-mcp

network-terminal-mcp

by evgenyzh

close_session

Terminates an interactive terminal session and its child process while preserving the final status for review.

Instructions

Close the terminal and child process, retaining its final status.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session_id": "<session_id>"
    },
    "name": "close_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idYes

Output Schema

NameRequiredDescriptionDefault
errorNo
stateYes
exit_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changedv0.5.0
    • removedOutput schema / description
      Removed value: -"Serializable session metadata returned by MCP tools."
    • removedOutput schema / properties / command
      Removed value: -{
      -  "title": "Command",
      -  "type": "string"
      -}
    • removedOutput schema / properties / created_at
      Removed value: -{
      -  "format": "date-time",
      -  "title": "Created At",
      -  "type": "string"
      -}
    • removedOutput schema / properties / error / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedOutput schema / properties / error / default
      Removed value: -null
    • addedOutput schema / properties / error / type
      Added value: +"string"
    • removedOutput schema / properties / exit_code / anyOf
      Removed value: -[
      -  {
      -    "type": "integer"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedOutput schema / properties / exit_code / default
      Removed value: -null
    • addedOutput schema / properties / exit_code / type
      Added value: +"integer"
    • removedOutput schema / properties / idle_seconds
      Removed value: -{
      -  "default": 0,
      -  "description": "Seconds since the last output, or since session creation when no output has arrived yet.",
      -  "minimum": 0,
      -  "title": "Idle Seconds",
      -  "type": "number"
      -}
    • removedOutput schema / properties / last_output_at
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "format": "date-time",
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "UTC timestamp when output was last received; null if the session has not produced any output yet.",
      -  "title": "Last Output At"
      -}
    • removedOutput schema / properties / last_used_at
      Removed value: -{
      -  "format": "date-time",
      -  "title": "Last Used At",
      -  "type": "string"
      -}
    • removedOutput schema / properties / session_id
      Removed value: -{
      -  "title": "Session Id",
      -  "type": "string"
      -}
    • removedOutput schema / properties / warnings
      Removed value: -{
      -  "items": {
      -    "type": "string"
      -  },
      -  "title": "Warnings",
      -  "type": "array"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "session_id",
      -  "command",
      -  "state",
      -  "created_at",
      -  "last_used_at"
      -]New value: +[
      +  "state"
      +]
    • changedOutput schema / title
      Previous value: -"SessionInfo"New value: +"CloseReply"
  2. Changed10 schema fields changedv0.2.1
    • addedInput schema / additionalProperties
      Added value: +false
    • addedOutput schema / properties / command
      Added value: +{
      +  "title": "Command",
      +  "type": "string"
      +}
    • addedOutput schema / properties / error
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Error"
      +}
    • addedOutput schema / properties / exit_code
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Exit Code"
      +}
    • removedOutput schema / properties / host
      Removed value: -{
      -  "title": "Host",
      -  "type": "string"
      -}
    • addedOutput schema / properties / idle_seconds
      Added value: +{
      +  "default": 0,
      +  "description": "Seconds since the last output, or since session creation when no output has arrived yet.",
      +  "minimum": 0,
      +  "title": "Idle Seconds",
      +  "type": "number"
      +}
    • addedOutput schema / properties / last_output_at
      Added value: +{
      +  "anyOf": [
      +    {
      +      "format": "date-time",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "UTC timestamp when output was last received; null if the session has not produced any output yet.",
      +  "title": "Last Output At"
      +}
    • removedOutput schema / properties / prompt
      Removed value: -{
      -  "default": "",
      -  "title": "Prompt",
      -  "type": "string"
      -}
    • removedOutput schema / properties / route
      Removed value: -{
      -  "title": "Route",
      -  "type": "string"
      -}
    • changedOutput schema / required
      Previous value: -[
      -  "session_id",
      -  "route",
      -  "host",
      -  "state",
      -  "created_at",
      -  "last_used_at"
      -]New value: +[
      +  "session_id",
      +  "command",
      +  "state",
      +  "created_at",
      +  "last_used_at"
      +]
  3. First observedv0.1.1

TDQS

B3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses that the child process is closed and the final status is retained, but it does not state whether the operation is idempotent, whether it force-terminates processes, or what happens if the session is already closed.

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

Conciseness4/5

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

The description is a single front-loaded sentence with no wasted wording. It is appropriately sized, though it could include one more clause about session ID or idempotency without becoming verbose.

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?

An output schema exists, so return values need not be explained. However, for a one-parameter destructive tool with no annotations, the description should say more about the session_id source, process termination behavior, and post-close status availability.

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?

Schema description coverage is 0%, and the description never mentions the sole session_id parameter. It does not explain where the session ID comes from or its expected format, leaving the schema to carry a parameter it does not describe.

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 states a specific verb and resource: close a terminal session and its child process. It is clearly distinguishable from open_session and other siblings, though it does not explicitly define what a session is.

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?

There is no explicit guidance on when to call this versus alternatives such as session_status or read_output before closing. The agent must infer from the tool name that this is an end-of-session cleanup action.

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