Skip to content

discussion regarding userfriendly spec violation message #598

@Agent-Hellboy

Description

@Agent-Hellboy

Hi, what do you think of capturing spec violations wherever possible and providing a better message to the end user?
e.g., incorrect ping implementation

current log.

agent ❯ WARNING:root:Failed to validate notification: 15 validation errors for ServerNotification
  CancelledNotification.method
    Input should be 'notifications/cancelled' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  CancelledNotification.params
    Field required [type=missing, input_value={'method': 'ping', 'jsonrpc': '2.0'}, input_type=dict]
      For further information visit https://errors.pydantic.dev/2.12/v/missing
  ProgressNotification.method
    Input should be 'notifications/progress' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  ProgressNotification.params
    Field required [type=missing, input_value={'method': 'ping', 'jsonrpc': '2.0'}, input_type=dict]
      For further information visit https://errors.pydantic.dev/2.12/v/missing
  LoggingMessageNotification.method
    Input should be 'notifications/message' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  LoggingMessageNotification.params
    Field required [type=missing, input_value={'method': 'ping', 'jsonrpc': '2.0'}, input_type=dict]
      For further information visit https://errors.pydantic.dev/2.12/v/missing
  ResourceUpdatedNotification.method
    Input should be 'notifications/resources/updated' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  ResourceUpdatedNotification.params
    Field required [type=missing, input_value={'method': 'ping', 'jsonrpc': '2.0'}, input_type=dict]
      For further information visit https://errors.pydantic.dev/2.12/v/missing
  ResourceListChangedNotification.method
    Input should be 'notifications/resources/list_changed' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  ToolListChangedNotification.method
    Input should be 'notifications/tools/list_changed' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  PromptListChangedNotification.method
    Input should be 'notifications/prompts/list_changed' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  ElicitCompleteNotification.method
    Input should be 'notifications/elicitation/complete' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  ElicitCompleteNotification.params
    Field required [type=missing, input_value={'method': 'ping', 'jsonrpc': '2.0'}, input_type=dict]
      For further information visit https://errors.pydantic.dev/2.12/v/missing
  TaskStatusNotification.method
    Input should be 'notifications/tasks/status' [type=literal_error, input_value='ping', input_type=str]
      For further information visit https://errors.pydantic.dev/2.12/v/literal_error
  TaskStatusNotification.params
    Field required [type=missing, input_value={'method': 'ping', 'jsonrpc': '2.0'}, input_type=dict]
      For further information visit https://errors.pydantic.dev/2.12/v/missing. Message was: method='ping' params=None jsonrpc='2.0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions