yera.tools.mcp.metadata

Public metadata exposed by MCP-backed Yera tools.

Symbols

class MCPServerMetadata — Describe the configured server that supplied an MCP tool.
class MCPToolAnnotations — Retain the behavioural hints advertised by an MCP server.
class MCPToolIcon — Describe an icon advertised for an MCP tool.
class MCPToolMetadata — Describe an imported MCP tool without refreshing the remote server.

MCPServerMetadata

Describe the configured server that supplied an MCP tool.

Fields

name
type: str (required)

Yera's configured name for the server.

url
type: str (required)

Streamable HTTP endpoint used to reach the server.

Methods


MCPServerMetadata.__init__

__init__(
    name: str,
    url: str,
) → None

MCPToolAnnotations

Retain the behavioural hints advertised by an MCP server.

These values are untrusted hints and must not be treated as an authorization or security boundary.

Fields

title
type: str | None = None

Alternate human-readable title.

read_only_hint
type: bool | None = None

Whether the server claims the tool is read-only.

destructive_hint
type: bool | None = None

Whether the server claims writes may be destructive.

idempotent_hint
type: bool | None = None

Whether repeated calls should have no additional effect.

open_world_hint
type: bool | None = None

Whether the tool may interact with external entities.

Methods

from_dict — Build annotations from serialized MCP protocol metadata.

MCPToolAnnotations.from_dict

from_dict(
    values: Mapping[str, object] | None,
) → MCPToolAnnotations

Build annotations from serialized MCP protocol metadata.

Parameters

values
type: Mapping[str, object] | None

Serialized annotations, or None when absent.

Returns

type: MCPToolAnnotations

Parsed server-supplied annotation hints.

MCPToolAnnotations.__init__

__init__(
    title: str | None = None,
    read_only_hint: bool | None = None,
    destructive_hint: bool | None = None,
    idempotent_hint: bool | None = None,
    open_world_hint: bool | None = None,
) → None

MCPToolIcon

Describe an icon advertised for an MCP tool.

Fields

src
type: str (required)

Icon URL or data URI supplied by the server.

mime_type
type: str | None = None

Optional advertised media type.

sizes
type: tuple[str, ...] = ()

Optional supported icon sizes.

theme
type: Optional[Literal['light', 'dark']] = None

Optional light or dark theme restriction.

Methods

from_dict — Build an icon description from serialized MCP metadata.

MCPToolIcon.from_dict

from_dict(
    values: Mapping[str, object],
) → MCPToolIcon

Build an icon description from serialized MCP metadata.

Parameters

values
type: Mapping[str, object]

Serialized icon metadata.

Returns

type: MCPToolIcon

Parsed icon metadata without fetching its source.

MCPToolIcon.__init__

__init__(
    src: str,
    mime_type: str | None = None,
    sizes: tuple[str, ...] = (),
    theme: Literal['light', 'dark'] | None = None,
) → None

MCPToolMetadata

Describe an imported MCP tool without refreshing the remote server.

Fields

path
type: str (required)

Fully qualified Python path beneath yr.mcp.

python_name
type: str (required)

Python-safe leaf name.

remote_name
type: str (required)

Exact tool name advertised by the MCP server.

server
type: yera.tools.mcp.metadata.MCPServerMetadata (required)

Configured server identity.

title
type: str | None (required)

Preferred human-readable title.

description
type: str | None (required)

Human-readable tool description.

input_schema
type: collections.abc.Mapping[str, object] (required)

Advertised JSON Schema for tool arguments.

output_schema
type: collections.abc.Mapping[str, object] | None (required)

Optional advertised JSON Schema for structured output.

annotations
type: yera.tools.mcp.metadata.MCPToolAnnotations (required)

Untrusted behavioural hints supplied by the server.

icons
type: tuple[yera.tools.mcp.metadata.MCPToolIcon, ...] (required)

Icon descriptions retained without fetching their contents.

task_support
type: Optional[Literal['forbidden', 'optional', 'required']] (required)

Advertised legacy task-execution support.

extensions
type: collections.abc.Mapping[str, object] (required)

Arbitrary namespaced MCP metadata.

Methods

from_record — Build public metadata from a locally cached catalogue record.

MCPToolMetadata.from_record

from_record(
    server_name: str,
    server_url: str,
    record: MCPToolRecord,
) → MCPToolMetadata

Build public metadata from a locally cached catalogue record.

Parameters

server_name
type: str

Yera's configured name for the server.

server_url
type: str

Configured Streamable HTTP endpoint.

record
type: MCPToolRecord

Cached tool discovery metadata.

Returns

type: MCPToolMetadata

Public metadata for local inspection.

MCPToolMetadata.__init__

__init__(
    path: str,
    python_name: str,
    remote_name: str,
    server: MCPServerMetadata,
    title: str | None,
    description: str | None,
    input_schema: Mapping[str, object],
    output_schema: Mapping[str, object] | None,
    annotations: MCPToolAnnotations,
    icons: tuple[MCPToolIcon, ...],
    task_support: Literal['forbidden', 'optional', 'required'] | None,
    extensions: Mapping[str, object],
) → None