<#1120 MCP list_queries cannot decode the v0.6.1 p...
# osctrl
g
#1120 MCP list_queries cannot decode the v0.6.1 paginated query response Issue created by pixel8ed MCP
list_queries
fails with the official v0.6.1 client against the v0.6.1 API. The API request succeeds, but the shared client tries to decode the paginated response as a query array. Environment • osctrl API and official osctrl-mcp client: v0.6.1, commit
e65598fe91422fac7a196a59af638b0397aab41c
. • API: published Linux amd64 image
jmpsec/osctrl-api:0.6.1
, digest
sha256:82325aa78540808d35832f14cabcf497d59c748e1c730688700437b7c80f17b4
. • MCP client: official Darwin arm64 release binary. • Authenticated caller with query permission on the requested environment. Reproduction 1. Connect the official osctrl-mcp client to the v0.6.1 API. 2. Call
list_queries
with an accessible environment and
target: "active"
or
target: "all"
. The environment name below is a placeholder: { "name": "list_queries", "arguments": { "environment": "example", "target": "active" } } 1. The tool returns:
Copy code
can not parse body - json: cannot unmarshal object into Go value of type []queries.DistributedQuery
A direct authenticated
GET /api/v1/queries/{env}/list/active?page=1&page_size=1
succeeds with HTTP 200. With no active queries, its response is: { "items": [], "page": 1, "page_size": 1, "total_items": 0, "total_pages": 0 } The same parsing failure occurs for
all
when stored queries exist. Other MCP inventory and node-detail reads succeed. Expected behavior Return query summaries, including an empty list when there are no matching queries. Handle pagination without silently dropping later pages. Source mismatch • GetQueries unmarshals the entire response into
[]queries.DistributedQuery
. • QueryListHandler returns
types.QueriesPagedResponse
. • MCP list_queries uses that shared client method. The decoder is still unchanged on
develop
at the October 26 check. A regression test exercising the real HTTP response contract, including empty results and multiple pages, would cover this failure. jmpsec/osctrl