-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Is your feature request related to a problem? Please describe.
The use of free-form text prompts to define complex, multi-step, procedural tasks is a source of execution unreliability. A non-deterministic language model is ill-suited for orchestrating rigid, algorithmic processes, which can result in execution errors such as skipping steps, hallucinating new steps, or failing to terminate correctly.
Describe the solution you'd like
Introduce a new, structured resource type on the MCP server, provisionally named "workflow." A workflow would be defined in a machine-readable format (e.g., JSON or YAML) that explicitly outlines the sequence of operations. This definition would include the specific tool calls, control flow logic such as loops and conditionals, and designated points where LLM intervention for non-procedural tasks (like summarization) is required.
This allows a client application to fetch the structured workflow and use a local, deterministic engine to execute the plan, ensuring a predictable and correct outcome.
Example of a Structured Workflow Definition:
name: databaseQualityWorkflow
description: "Performs a comprehensive data quality assessment on all tables in a database."
phases:
- name: "Get Database Tables"
steps:
- tool: base_tableList
args:
db_name: "{{db_name}}" # Input parameter
provides: table_list
- name: "Collect Table Information"
loop:
over: table_list
as: table
steps:
- tool: base_tableDDL
args:
db_name: "{{db_name}}"
table_name: "{{table.TableName}}"
provides: ddl_output
- llm_step:
prompt: "Generate a business description for the table and columns based on this DDL: {{ddl_output.results[0].Request Text}}"
provides: business_description
- tool: qlty_columnSummary
args:
database_name: "{{db_name}}"
table_name: "{{table.TableName}}"Describe alternatives you've considered
The primary alternative is to continue using natural language prompts and attempt to improve reliability through advanced prompt engineering. This involves adding more constraints, rules, and few-shot examples to guide the language model. This approach is suboptimal as it increases prompt complexity and token cost, and it does not guarantee deterministic execution for tasks that are fundamentally procedural.
Additional context
Implementing workflows as a distinct, structured resource allows for a clear separation of concerns. It enables client systems to use the appropriate execution strategy for a given task: deterministic logic for rigid processes and non-deterministic LLM reasoning for flexible, creative, or interpretive tasks. This architectural distinction improves the overall robustness and predictability of agentic systems built on top of the MCP server.