modelcontextprotocol / modelcontextprotocol/php-sdk

[Client] Fill elicitation defaults when accepting (SEP-1034)

Open
#328 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client enhancement improves spec compliance Schema
Dominant language
PHP
Stars
1.6k
Forks
173
Avg merge
2d 49m
Merged PRs (30d)
23

Description

Context

SEP-1034 adds client-side default handling for elicitation/create. When a client accepts an elicitation request without explicit field values, the response content should be auto-populated from default fields declared in the request's requestedSchema. Schemas already expose default on StringSchemaDefinition, NumberSchemaDefinition, EnumSchemaDefinition, TitledEnumSchemaDefinition, and BooleanSchemaDefinition.

Scope

  • Add helper ElicitationSchema::extractDefaults(): array<string, mixed> returning a field => default map for all properties that declare one.
  • Document the helper as the canonical "accept-with-defaults" path; update the example in tests/Conformance/client.php to use it for elicitation-sep1034-client-defaults.
  • Optional convenience: ElicitResult::accepted(ElicitationSchema $schema) factory that pre-fills defaults.

Conformance scenarios unblocked

elicitation-sep1034-client-defaults.

Dependencies

Independent.

Acceptance

  • Unit test on ElicitationSchema::extractDefaults covering all 5 definition types.
  • Conformance: scenario passes (after #328 wiring lands, see below).

cc @soyuka

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ElicitationSchema and the five schema definition types that expose default values, then inspect tests/Conformance/client.php and the elicitation-sep1034-client-defaults scenario. Add the extractDefaults unit coverage and update the example to use the helper; done means all five types are covered and the conformance scenario passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.