Skip to content

Cannot deserialize ResourceLinkBlock #644

@KrakerXyz

Description

@KrakerXyz

Describe the bug
Attempting to deserialize a ResourceLinkBlock throws JsonException

In src/ModelContextProtocol.Core/Protocol/ContentBlock.cs, we're missing a switch case to read the "name" property which results in name never being deserialized and consequently a JsonException being thrown here

Name = name ?? throw new JsonException("Name must be provided for 'resource_link' type."),

To Reproduce
Steps to reproduce the behavior:

  1. Create a valid ResourceLinkBlock with Name
  2. Serialize to Json
  3. Attempt to deserialize

Expected behavior
Deserializes back to original state

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions