Wire Types Reference¶
lauren_mcp
¶
lauren-mcp — Model Context Protocol server and client for Lauren applications.
JsonRpcRequest
dataclass
¶
A JSON-RPC 2.0 request (has both method and id).
JsonRpcNotification
dataclass
¶
A JSON-RPC 2.0 notification (has method but no id).
JsonRpcResponse
dataclass
¶
A JSON-RPC 2.0 success response.
JsonRpcErrorResponse
dataclass
¶
A JSON-RPC 2.0 error response.
McpErrorCode
¶
Bases: IntEnum
Standard JSON-RPC and MCP-extension error codes.
ToolSchema
dataclass
¶
ToolSchema(
name,
description,
inputSchema=dict(),
outputSchema=None,
annotations=None,
title=None,
)
Descriptor for a single MCP tool.
ResourceSchema
dataclass
¶
Descriptor for a single MCP resource.
PromptSchema
dataclass
¶
Descriptor for a single MCP prompt.
ImageContent
dataclass
¶
A base64-encoded image content item.
parse_message
¶
Parse a raw JSON string or bytes into the appropriate JSON-RPC type.
Dispatch rules (per JSON-RPC 2.0 spec):
- Has both
methodandid→ :class:JsonRpcRequest - Has
methodbut noid→ :class:JsonRpcNotification - Has
result(nomethod) → :class:JsonRpcResponse - Has
error(nomethod) → :class:JsonRpcErrorResponse
Raises :class:McpParseError on bad JSON, missing jsonrpc field,
or a shape that matches none of the above.
Source code in src/lauren_mcp/_types.py
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 | |
build_error_response
¶
Construct a :class:JsonRpcErrorResponse from primitive parts.
Source code in src/lauren_mcp/_types.py
AudioContent
dataclass
¶
A base64-encoded audio content item.
data must be base64-encoded audio bytes. mimeType should be a
valid audio MIME type such as "audio/wav", "audio/mpeg", or
"audio/ogg".
from_bytes
classmethod
¶
Construct from raw audio data, base64-encoding it automatically.
ResourceLink
dataclass
¶
A lightweight reference to a resource by URI.
Unlike :class:EmbeddedResource, a ResourceLink does not inline
the resource's content — it provides only the URI and optional metadata.
The MCP client may choose to fetch the resource separately via
resources/read if needed.
ToolUseContent
dataclass
¶
A tool invocation block inside a sampling message.
Represents the LLM requesting to call a tool, as returned inside a
sampling/createMessage response when the model decides to use a tool.
Also used when re-sending past assistant turns that contained tool calls.
Attributes¶
id:
Unique opaque identifier for this tool call, supplied by the model.
Must match the tool_use_id of the corresponding
:class:ToolResultContent.
name:
Name of the tool to call.
input:
Tool arguments as a JSON-serialisable dict. No schema validation is
performed here — the tool author is responsible.
type:
Wire discriminator. Always "tool_use"; do not override.
ToolResultContent
dataclass
¶
The result of a prior tool invocation, placed in a user-role message.
When the tool author has handled the :class:ToolUseContent from an
assistant turn, they create a ToolResultContent and append it as a
role="user" :class:SamplingMessage to continue the conversation.
Attributes¶
tool_use_id:
Must match the id of the :class:ToolUseContent this result
corresponds to.
content:
One or more content blocks (text or image) that constitute the tool's
output. An empty list is valid (the tool produced no output).
is_error:
Set to True when the tool call failed; the LLM can then decide
how to proceed.
type:
Wire discriminator. Always "tool_result"; do not override.
ResourceAnnotations
dataclass
¶
Annotations attached to an MCP resource for UI and routing hints.
Attributes:
| Name | Type | Description |
|---|---|---|
audience |
list[Role] | None
|
List of intended readers; omitted means unrestricted.
Valid values are |
priority |
float | None
|
Relevance weighting in |
UrlElicitResult
dataclass
¶
Result of a URL-elicitation elicitation/create request.
action values:
"accept"— the user completed the external URL flow successfully."cancel"— the user dismissed the dialog or the flow was aborted.
Note: URL elicitation has no "decline" state. The only outcomes are
completion ("accept") or abandonment ("cancel").
CompletionResult
dataclass
¶
Result of a completion/complete request.