oas2mcp.agent.state

Typed state definitions for oas2mcp agents.

Purpose:

Define the state carried through stateful OpenAPI enhancement workflows.

Design:
  • Use TypedDict because LangChain v1 custom agent state requires it.

  • Keep the state centered on the source URL and progressively enriched API understanding.

  • Store deterministic catalog artifacts plus enhancer results so they can later be exported into an enhanced spec/config surface.

Examples

state: OpenApiEnhancementState = {
    "source_url": "https://example.com/openapi.json",
}

Classes

OpenApiEnhancementState

State carried through the OpenAPI enhancement workflow.

OperationEnhancementRecord

Serializable enhancer result stored in agent state.

Module Contents

class oas2mcp.agent.state.OpenApiEnhancementState[source][source]

Bases: langchain.agents.AgentState

State carried through the OpenAPI enhancement workflow.

candidate_bundle: NotRequired[object][source][source]
catalog: NotRequired[object][source][source]
catalog_summary: NotRequired[object][source][source]
catalog_summary_context: NotRequired[object][source][source]
completed_steps: NotRequired[list[str]][source][source]
current_operation_key: NotRequired[str][source][source]
enhanced_operations: NotRequired[list[OperationEnhancementRecord]][source][source]
enhancement_todo: NotRequired[list[str]][source][source]
notes: NotRequired[list[str]][source][source]
operation_keys: NotRequired[list[str]][source][source]
remaining_operation_keys: NotRequired[list[str]][source][source]
source_url: str[source][source]
class oas2mcp.agent.state.OperationEnhancementRecord[source][source]

Bases: langchain.agents.AgentState

Serializable enhancer result stored in agent state.

description: str[source][source]
final_kind: str[source][source]
notes: list[str][source][source]
operation_key: str[source][source]
operation_slug: str[source][source]
requires_confirmation: bool[source][source]
resource_uri: str | None[source][source]
title: str[source][source]
tool_name: str | None[source][source]