oas2mcp.agent.enhancer.prompts

Prompt builders for the operation enhancer agent.

Purpose:

Build prompt text for refining one normalized API operation into a cleaner MCP-friendly representation.

Design:
  • Keep prompt construction deterministic.

  • Use dynamic prompt middleware for runtime-aware instructions.

  • Keep the enhancer focused on one operation at a time.

  • Treat deterministic candidate values as hints, not final truth.

  • Make the required structured output explicit to reduce empty-object failures during orchestrated batch runs.

Examples

system_prompt = build_operation_enhancer_system_prompt()
user_prompt = build_operation_enhancer_user_prompt(context)

Functions

build_operation_enhancer_dynamic_prompt()

Build dynamic prompt middleware for the enhancer.

build_operation_enhancer_runtime_instruction_lines(...)

Build deterministic runtime-specific instructions for enhancer prompts.

build_operation_enhancer_system_prompt(→ str)

Build the base system prompt for the operation enhancer.

build_operation_enhancer_user_prompt(→ str)

Build the user prompt for one operation enhancement.

Module Contents

oas2mcp.agent.enhancer.prompts.build_operation_enhancer_dynamic_prompt()[source][source]

Build dynamic prompt middleware for the enhancer.

Parameters:

None.

Returns:

The LangChain dynamic prompt middleware callable.

Raises:

None.

oas2mcp.agent.enhancer.prompts.build_operation_enhancer_runtime_instruction_lines(runtime: oas2mcp.agent.runtime.Oas2McpRuntimeContext) list[str][source][source]

Build deterministic runtime-specific instructions for enhancer prompts.

oas2mcp.agent.enhancer.prompts.build_operation_enhancer_system_prompt() str[source][source]

Build the base system prompt for the operation enhancer.

Parameters:

None.

Returns:

The system prompt.

Return type:

str

Raises:

None.

oas2mcp.agent.enhancer.prompts.build_operation_enhancer_user_prompt(context: oas2mcp.agent.enhancer.models.OperationEnhancementContext) str[source][source]

Build the user prompt for one operation enhancement.

Parameters:

context – The operation enhancement context.

Returns:

The user prompt string.

Return type:

str

Raises:

None.