Skip to content

limactl-mcp: glob returns an error instead of an empty list #4173

@jandubois

Description

@jandubois

When the pattern doesn't match, I would expect to receive an empty list. Instead I get a marshalling error:

$ echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"glob","arguments":{"pattern":"READ*"}}}' >&"${MCP[1]}"

$ read -t 1 -r line <&"${MCP[0]}"; jq . <<<"$line"
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"matches\":[\"/Users/jan/suse/lima/README.md\"]}"
      }
    ],
    "structuredContent": {
      "matches": [
        "/Users/jan/suse/lima/README.md"
      ]
    }
  }
}

$ echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"glob","arguments":{"pattern":"XXX*"}}}' >&"${MCP[1]}"

$ read -t 1 -r line <&"${MCP[0]}"; jq . <<<"$line"
{
  "jsonrpc": "2.0",
  "id": 3,
  "error": {
    "code": 0,
    "message": "validating tool output: validating root: validating /properties/matches: type: <invalid reflect.Value> has type \"null\", want \"array\""
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mcpbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions