ProtocolContracts
Factory methods for protocol-level machine-readable contracts.
- Kind:
Class - Namespace: Repl.Protocol
- Assembly:
Repl.Protocol - Source: src/Repl.Protocol/ProtocolContracts.cs
Signature
Section titled “Signature”public static class ProtocolContractsInheritance
Section titled “Inheritance”Methods
Section titled “Methods”CreateError(string, string)
Section titled “CreateError(string, string)”Creates a structured protocol error.
public static ProtocolError CreateError(string code, string message)Parameters
Section titled “Parameters”Returns
Section titled “Returns”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)Parameters
Section titled “Parameters”scope(string): Scope path.commands(IEnumerable<HelpCommand>): Discoverable command metadata.
Returns
Section titled “Returns”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)Parameters
Section titled “Parameters”name(string): Server/display name.version(string): Manifest version.tools(IEnumerable<McpTool>): Tool descriptors.resources(IEnumerable<McpResource>): Resource descriptors.
Returns
Section titled “Returns”McpManifest - A machine-readable MCP manifest.
CreateMcpTool(HelpCommand)
Section titled “CreateMcpTool(HelpCommand)”Creates an MCP tool descriptor from a help command.
public static McpTool CreateMcpTool(HelpCommand command)Parameters
Section titled “Parameters”command(HelpCommand): Help command metadata.
Returns
Section titled “Returns”McpTool - A mapped MCP tool descriptor.
CreateMcpTools(HelpDocument)
Section titled “CreateMcpTools(HelpDocument)”Creates MCP tools from a help document using the command list as source.
public static IReadOnlyList<McpTool> CreateMcpTools(HelpDocument helpDocument)Parameters
Section titled “Parameters”helpDocument(HelpDocument): Help document.
Returns
Section titled “Returns”IReadOnlyList<McpTool> - Mapped MCP tools.