MCP PHP SDK

WireCodecInterface

Translates the SDK's revision-neutral result model into the wire shape one protocol era expects.

Fields that exist only from 2026-07-28 — resultType, the SEP-2549 caching hints, the _meta serverInfo identity — are stamped here rather than modelled on the result classes, so one set of results can serve every revision without older clients receiving vocabulary they have never seen.

Keyed by era, not version: every revision through 2025-11-25 shares one.

Tags
author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Methods

encodeResult()  : array<string, mixed>
Stamps an already-serialized result with whatever this era requires.

Methods

encodeResult()

Stamps an already-serialized result with whatever this era requires.

public encodeResult(string $method, array<string, mixed> $result[, bool $cacheable = true ]) : array<string, mixed>
Parameters
$method : string

the request method the result answers

$result : array<string, mixed>

the neutral result body

$cacheable : bool = true

whether this answer may carry caching hints at all — false for one produced by a multi round-trip retry, whose inputs are not part of any cache key

Return values
array<string, mixed>
On this page

Search results