Skip to content

ProtocolContracts

Factory methods for protocol-level machine-readable contracts.

public static class ProtocolContracts

Creates a structured protocol error.

public static ProtocolError CreateError(string code, string message)
  • code (string): Error code.
  • message (string): Error message.

ProtocolError - A protocol error object.

CreateHelpDocument(string, IEnumerable<HelpCommand>)

Section titled “CreateHelpDocument(string, IEnumerable<HelpCommand>)”

Creates a help document from scope and command metadata.

public static HelpDocument CreateHelpDocument(string scope, IEnumerable<HelpCommand> commands)
  • scope (string): Scope path.
  • commands (IEnumerable<HelpCommand>): Discoverable command metadata.

HelpDocument - A new help document.

CreateMcpManifest(string, string, IEnumerable<McpTool>, IEnumerable<McpResource>?)

Section titled “CreateMcpManifest(string, string, IEnumerable<McpTool>, IEnumerable<McpResource>?)”

Creates an MCP manifest for future multi-host integrations.

public static McpManifest CreateMcpManifest(string name, string version, IEnumerable<McpTool> tools, IEnumerable<McpResource>? resources = null)
  • name (string): Server/display name.
  • version (string): Manifest version.
  • tools (IEnumerable<McpTool>): Tool descriptors.
  • resources (IEnumerable<McpResource>): Resource descriptors.

McpManifest - A machine-readable MCP manifest.

Creates an MCP tool descriptor from a help command.

public static McpTool CreateMcpTool(HelpCommand command)

McpTool - A mapped MCP tool descriptor.

Creates MCP tools from a help document using the command list as source.

public static IReadOnlyList<McpTool> CreateMcpTools(HelpDocument helpDocument)

IReadOnlyList<McpTool> - Mapped MCP tools.