nemo_gym.tool_access

View as Markdown

Agent-visible tool access contracts.

Module Contents

Classes

NameDescription
DirectHTTPToolAccessConnect a trusted Python agent to typed tool routes.
MCPStreamableHTTPConnectionConnect to an MCP server over an absolute HTTP endpoint.
MCPToolAccessDescribe one named MCP server that an agent adapter must configure.

Data

ToolAccess

API

class nemo_gym.tool_access.DirectHTTPToolAccess()

Bases: BaseModel

Connect a trusted Python agent to typed tool routes.

base_url
AnyHttpUrl
cookies
dict[str, str] = Field(default_factory=dict)
headers
dict[str, str] = Field(default_factory=dict)
kind
Literal['direct_http'] = 'direct_http'
model_config
= ConfigDict(extra='forbid')
name
str
required
bool
class nemo_gym.tool_access.MCPStreamableHTTPConnection()

Bases: BaseModel

Connect to an MCP server over an absolute HTTP endpoint.

headers
dict[str, str] = Field(default_factory=dict)
model_config
= ConfigDict(extra='forbid')
transport
Literal['streamable_http'] = 'streamable_http'
url
AnyHttpUrl
class nemo_gym.tool_access.MCPToolAccess()

Bases: BaseModel

Describe one named MCP server that an agent adapter must configure.

Names are session-wide identifiers. Agent session requests reject duplicate names, and adapters must also reject collisions with their static tool configuration. Failure to establish a required server fails session seeding; an optional server may be skipped. On agent-session close, adapters disconnect clients without stopping the remote server.

connection
MCPStreamableHTTPConnection
kind
Literal['mcp'] = 'mcp'
model_config
= ConfigDict(extra='forbid')
name
str
required
bool
nemo_gym.tool_access.ToolAccess = Annotated[DirectHTTPToolAccess | MCPToolAccess, Field(discriminator='kind')]