ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

One statically reachable argument mirrored into a lowercase HTTP header.

Class HeaderBinding One statically reachable argument mirrored into a lowercase HTTP header.
Function _argument Read the exact compiled property path without interpreting dotted keys.
Function _binding Validate the name and primitive type at one reachable property.
Function _contains_annotation Locate annotations even inside unsupported schema constructs.
Function _decode_value Validate ASCII transport syntax and decode the exact Base64 sentinel.
Function _matches_integer Compare safe JSON integers numerically, accepting equivalent 42.0 values.
Function _matches_value Compare mirrored parameters without coercing booleans into integers.
Function _mismatch Report the failing header without reflecting untrusted field values.
Function _parameter Read either decoded protocol structs or an unknown method's raw mapping.
Function _single_header Require one field occurrence, including case-insensitive duplicates.
Function _validate_binding Require mirrored values precisely when their argument is present and non-null.
Function _validate_standard Compare one required standard header with its corresponding body field.
Function _validate_version Distinguish invalid body metadata from a missing or disagreeing header.
Function _walk_properties Visit named object properties with statically known extraction paths.
Function _walk_schema Visit properties chains and reject annotations hidden elsewhere.
Function compile_header_bindings Validate tool schema annotations once and freeze extraction paths.
Function validate_headers Enforce mirrored request metadata before protocol method dispatch.
Constant _ANNOTATION x-mcp-header.
Constant _NAMED_METHODS Named methods used by headers.
Constant _NUMBER Compiled pattern used to recognize number.
Constant _PLAIN Compiled pattern used to recognize plain.
Constant _PREFIX =?base64?.
Constant _SAFE_INTEGER Safe integer value used by headers.
Constant _SUFFIX ?=.
Constant _TOKEN Compiled pattern used to recognize token.
Type Alias HeaderKind Type alias for Literal['string', 'integer', 'boolean'].
def _argument(arguments: object, path: tuple[str, ...]) -> object: (source)

Read the exact compiled property path without interpreting dotted keys.

Parameters
arguments:objectArguments supplied for this operation.
path:tuple[str, ...]Value supplied for path.
Returns
objectResult of the operation described above.
def _binding(schema: Mapping[str, object], path: tuple[str, ...]) -> HeaderBinding: (source)

Validate the name and primitive type at one reachable property.

Parameters
schema:collections.abc.Mapping[str, object]Schema declaration used for conversion and validation.
path:tuple[str, ...]Value supplied for path.
Returns
orionis.mcp.transport.headers.HeaderBindingResult of the operation described above.
def _contains_annotation(value: object) -> bool: (source)

Locate annotations even inside unsupported schema constructs.

Parameters
value:objectValue to inspect, transform or validate.
Returns
boolResult of the operation described above.
def _decode_value(value: str, name: str, *, encoded: bool) -> str: (source)

Validate ASCII transport syntax and decode the exact Base64 sentinel.

Parameters
value:strValue to inspect, transform or validate.
name:strValue supplied for name.
encoded:boolValue supplied for encoded.
Returns
strResult of the operation described above.
def _matches_integer(header: str, value: object) -> bool: (source)

Compare safe JSON integers numerically, accepting equivalent 42.0 values.

Parameters
header:strValue supplied for header.
value:objectValue to inspect, transform or validate.
Returns
boolResult of the operation described above.
def _matches_value(binding: HeaderBinding, header: str, value: object) -> bool: (source)

Compare mirrored parameters without coercing booleans into integers.

Parameters
binding:orionis.mcp.transport.headers.HeaderBindingValue supplied for binding.
header:strValue supplied for header.
value:objectValue to inspect, transform or validate.
Returns
boolResult of the operation described above.
def _mismatch(name: str) -> McpProtocolException: (source)

Report the failing header without reflecting untrusted field values.

Parameters
name:strValue supplied for name.
Returns
orionis.mcp.exceptions.McpProtocolExceptionResult of the operation described above.
def _parameter(params: RequestParams | Mapping[str, object], name: str) -> object: (source)

Read either decoded protocol structs or an unknown method's raw mapping.

Parameters
params:RequestParams | Mapping[str, object]Parameters decoded for the requested operation.
name:strValue supplied for name.
Returns
objectResult of the operation described above.
def _single_header(headers: Headers, name: str, *, encoded: bool = False) -> str: (source)

Require one field occurrence, including case-insensitive duplicates.

Parameters
headers:orionis.http.payload.estructures.headers.HeadersValue supplied for headers.
name:strValue supplied for name.
encoded:boolValue supplied for encoded.
Returns
strResult of the operation described above.
def _validate_binding(headers: Headers, binding: HeaderBinding, arguments: object): (source)

Require mirrored values precisely when their argument is present and non-null.

Parameters
headers:orionis.http.payload.estructures.headers.HeadersValue supplied for headers.
binding:orionis.mcp.transport.headers.HeaderBindingValue supplied for binding.
arguments:objectArguments supplied for this operation.
Returns
NoneComplete the documented operation without returning a value.
def _validate_standard(headers: Headers, name: str, expected: object, *, encoded: bool = False): (source)

Compare one required standard header with its corresponding body field.

Parameters
headers:orionis.http.payload.estructures.headers.HeadersValue supplied for headers.
name:strValue supplied for name.
expected:objectValue supplied for expected.
encoded:boolValue supplied for encoded.
Returns
NoneComplete the documented operation without returning a value.
def _validate_version(headers: Headers, metadata: object): (source)

Distinguish invalid body metadata from a missing or disagreeing header.

Parameters
headers:orionis.http.payload.estructures.headers.HeadersValue supplied for headers.
metadata:objectMetadata associated with the current operation.
Returns
NoneComplete the documented operation without returning a value.
def _walk_properties(properties: Mapping[str, object], path: tuple[str, ...], bindings: list[HeaderBinding]): (source)

Visit named object properties with statically known extraction paths.

Parameters
properties:collections.abc.Mapping[str, object]Named child schemas.
path:tuple[str, ...]Parent property path.
bindings:list[orionis.mcp.transport.headers.HeaderBinding]Accumulator for mirrored header declarations.
Returns
NoneValid child mappings have been visited in declaration order.
def _walk_schema(schema: Mapping[str, object], path: tuple[str, ...], bindings: list[HeaderBinding]): (source)

Visit properties chains and reject annotations hidden elsewhere.

Parameters
schema:collections.abc.Mapping[str, object]Schema declaration used for conversion and validation.
path:tuple[str, ...]Value supplied for path.
bindings:list[orionis.mcp.transport.headers.HeaderBinding]Declared bindings associated with this operation.
Returns
NoneComplete the documented operation without returning a value.
def compile_header_bindings(input_schema: Mapping[str, object]) -> tuple[HeaderBinding, ...]: (source)

Validate tool schema annotations once and freeze extraction paths.

Parameters
input_schema:collections.abc.Mapping[str, object]Value supplied for input_schema.
Returns
tuple[orionis.mcp.transport.headers.HeaderBinding, ...]Result of the operation described above.
def validate_headers(headers: Headers, envelope: JsonRpcRequest, params: RequestParams | Mapping[str, object] | None = None, bindings: tuple[HeaderBinding, ...] = ()): (source)

Enforce mirrored request metadata before protocol method dispatch.

Unknown methods may omit params here to decode only their raw mapping. Notifications have no metadata-header requirements in this protocol revision.

Parameters
headers:orionis.http.payload.estructures.headers.HeadersValue supplied for headers.
envelope:orionis.mcp.protocol.requests.JsonRpcRequestValue supplied for envelope.
params:RequestParams | Mapping[str, object] | NoneParameters decoded for the requested operation.
bindings:tuple[orionis.mcp.transport.headers.HeaderBinding, ...]Declared bindings associated with this operation.
Returns
NoneComplete the documented operation without returning a value.
_ANNOTATION: str = (source)

x-mcp-header.

Value
'x-mcp-header'
_NAMED_METHODS = (source)

Named methods used by headers.

Value
frozenset(set(['tools/call', 'resources/read', 'prompts/get']))

Compiled pattern used to recognize number.

Value
re.compile(r'-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][\+-]?\d+)?\Z',
           re.ASCII)

Compiled pattern used to recognize plain.

Value
re.compile(r'(?:[!-~](?:[\t -~]*[!-~])?)?\Z')

=?base64?.

Value
'=?base64?'
_SAFE_INTEGER: int = (source)

Safe integer value used by headers.

Value
9007199254740991

?=.

Value
'?='

Compiled pattern used to recognize token.

Value
re.compile(r'[!#\$%&\'\*\+-\.\^_`\|~0-9A-Za-z]+\Z')

Type alias for Literal['string', 'integer', 'boolean'].

Value
Literal['string', 'integer', 'boolean']