Description
When using scalar types like bool or str as response_type in ctx.elicit(), FastMCP wraps them in an object schema with a hardcoded property name "value" and title "ScalarElicitationType":
{"requestedSchema":{"properties":{"value":{"title":"Value","type":"boolean"}},"required":["value"],"title":"ScalarElicitationType","type":"object"}}
Clients like VS Code render these as the field label ("Value") and object title ("ScalarElicitationType"), which looks generic and confusing to users. The MCP spec supports title and description on individual properties (spec reference).
Current workaround
Use a full Pydantic BaseModel to get control over field titles:
from pydantic import BaseModel, Field
class PurchaseConfirmation(BaseModel):
confirm: bool = Field(title="Confirm purchase", description="Approve this transaction?")
response = await ctx.elicit(message="Buy 1x Baguette?", response_type=PurchaseConfirmation)
This works but is verbose for a simple confirmation.
Proposed enhancement
Allow passing title and/or description kwargs to ctx.elicit() when using scalar types, which would be applied to the wrapped property:
# Hypothetical API
response = await ctx.elicit(
message="Buy 1x Baguette?",
response_type=bool,
title="Confirm purchase",
description="Approve this transaction?",
)
Environment
Description
When using scalar types like
boolorstrasresponse_typeinctx.elicit(), FastMCP wraps them in an object schema with a hardcoded property name"value"and title"ScalarElicitationType":{"requestedSchema":{"properties":{"value":{"title":"Value","type":"boolean"}},"required":["value"],"title":"ScalarElicitationType","type":"object"}}Clients like VS Code render these as the field label ("Value") and object title ("ScalarElicitationType"), which looks generic and confusing to users. The MCP spec supports
titleanddescriptionon individual properties (spec reference).Current workaround
Use a full Pydantic
BaseModelto get control over field titles:This works but is verbose for a simple confirmation.
Proposed enhancement
Allow passing
titleand/ordescriptionkwargs toctx.elicit()when using scalar types, which would be applied to the wrapped property:Environment