Skip to content

resultType on every result, for the clients that require it (#107) - #122

Merged
TGoodhew merged 1 commit into
mainfrom
issue-107-result-type
Jul 31, 2026
Merged

resultType on every result, for the clients that require it (#107)#122
TGoodhew merged 1 commit into
mainfrom
issue-107-result-type

Conversation

@TGoodhew

Copy link
Copy Markdown
Owner

Closes #107. Second of the conformance block; builds directly on #106.

SEP-2322 makes resultType required on every result — "complete" for an ordinary one, "input_required" for a Multi Round-Trip interim result. We return no interim results (the server initiates no sampling, elicitation or roots requests), so this is the "complete" half only; MRTR stays out of scope as the issue says.

Change

  • resultType: "complete" on every result when the request declares 2026-07-28 or later. That gate is per request, which is exactly why this waited on the request-context work.
  • Older clients get nothing new. They are told to read an absent field as "complete", and may validate strictly against a schema with no field for it — adding it there is risk without meaning.
  • The gate is an ordinal comparison on the dated revision name (RequestContext.DeclaresRevisionAtLeast), so a future revision inherits the newer behaviour rather than falling back to the older one.

Two things worth a look

It never overwrites a value already present. A CreateTaskResult is "task"; stamping "complete" over it would tell the client the work had finished when it has not started. One line, but it is the bug this PR would otherwise have shipped.

A tool result nested inside a later tasks/get is the awkward case: the poll carries its own _meta, not the caller's, and the result was produced before the poll existed. The revision the creating request declared decides the nested shape, so a client that asked in 2026-07-28 gets resultType on both the poll and the result inside it.

Verification

  • 5 new tests — set for ping/tools/list/tools/call on the new revision; absent with no _meta and absent on 2025-06-18; applied to a later-dated revision; and the task case end to end (handle stays "task", poll is "complete", nested tool result is "complete").
  • Full suite green: 365 GpibMcp + 113 Hpgl, 0 failures (Release|x86) — was 361 + 113.

README: the "Protocol revisions" section now covers it.

)

SEP-2322 makes resultType required on every result: "complete" for an ordinary
one, "input_required" for an MRTR interim result. We return no interim results -
the server initiates no sampling, elicitation or roots requests - so this is the
"complete" half only.

Set only when the request declares 2026-07-28 or later. A client on an older
revision is told to read an absent field as "complete" anyway, and may validate
strictly against a schema with no field for it, so adding it there would be risk
without meaning. Which revision that is arrives per request now, which is why
this waited on #106.

Never overwrites a value already there: a CreateTaskResult is "task", and saying
"complete" over the top would tell the client the work had finished when it has
not started. Revisions are dated names, so the gate is an ordinal comparison and
a future revision inherits the newer behaviour.

The one awkward case is a tool result nested inside a later tasks/get: the poll
carries its own context, not the caller's, so the revision the CREATING request
asked in decides the nested shape.

5 tests.
@TGoodhew
TGoodhew merged commit 7ecc42f into main Jul 31, 2026
1 check passed
@TGoodhew
TGoodhew deleted the issue-107-result-type branch July 31, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP 2026-07-28: add the required resultType field to every result

1 participant