oas2mcp.agent.enhancer.context ============================== .. py:module:: oas2mcp.agent.enhancer.context .. autoapi-nested-parse:: Deterministic context builders for the operation enhancer agent. Purpose: Build compact, structured context objects for refining one normalized API operation into a more MCP-friendly representation. Design: - Keep context building deterministic and side-effect free. - Combine normalized operation data, deterministic MCP candidate data, resolved schemas, and catalog summary context. - Treat deterministic MCP candidate values as hints rather than final truth. - Keep the enhancer context focused on the current operation. .. rubric:: Examples .. code-block:: python context = build_operation_enhancement_context( catalog=catalog, bundle=bundle, summary=summary, operation=operation, ) Functions --------- .. autoapisummary:: oas2mcp.agent.enhancer.context.build_operation_enhancement_context Module Contents --------------- .. py:function:: build_operation_enhancement_context(*, catalog: oas2mcp.models.normalized.ApiCatalog, bundle: oas2mcp.models.mcp.McpBundle, summary: oas2mcp.agent.summarizer.models.CatalogSummary, operation: oas2mcp.models.normalized.ApiOperation) -> oas2mcp.agent.enhancer.models.OperationEnhancementContext Build deterministic enhancer context for one operation. :param catalog: The normalized API catalog. :param bundle: The deterministic MCP bundle. :param summary: The catalog-level summary. :param operation: The operation to enhance. :returns: Deterministic context for one operation. :rtype: OperationEnhancementContext :raises KeyError: If no MCP candidate exists for the operation. .. rubric:: Examples .. code-block:: python context = build_operation_enhancement_context( catalog=catalog, bundle=bundle, summary=summary, operation=operation, )