Skip to content

Handling of optional output fields in limactl-mcp #4124

@jandubois

Description

@jandubois

When looking at the output schema, I find that all optional output fields (except strings) are defined as pointers. Looking at the .outputSchema property for the run_shell_command tool:

{
  "type": "object",
  "required": [
    "stdout",
    "stderr"
  ],
  "properties": {
    "error": {
      "type": "string",
      "description": "Any error message reported by the subprocess."
    },
    "exit_code": {
      "type": [
        "null",
        "integer"
      ],
      "description": "Exit code of the command."
    },
    "stderr": {
      "type": "string",
      "description": "Output from the standard error stream."
    },
    "stdout": {
      "type": "string",
      "description": "Output from the standard output stream."
    }
  },
  "additionalProperties": false
}

exit_code has a type of null, or integer, but that is kind of redundant because it is not a required output fields.

But error is not a required output field either, and it is just string, and not null, or string, which feels inconsistent.

But ignoring this, why is exit_code not a required output value? Does the tool ever return before the shell command exits? How can you not have an output value?


I think the description of error is also confusing, as it is not an error reported by the subprocess, but an error reported by the MCP because running the subprocess failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions