Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,14 @@ def workflow_as_mcp(
async def _workflow_tool(run_args: StartEventCLS, context: Context) -> Any:
# Handle edge cases where the start event is an Event or a BaseModel
# If the workflow does not have a custom StartEvent class, then we need to handle the event differently
context.session

if isinstance(run_args, Event) and workflow._start_event_class != StartEvent:
handler = workflow.run(start_event=run_args)
elif isinstance(run_args, BaseModel):
handler = workflow.run(**run_args.model_dump())
elif isinstance(run_args, dict):
start_event = StartEventCLS.model_validate(run_args)
handler = workflow.run(start_event=start_event)
else:
raise ValueError(f"Invalid start event type: {type(run_args)}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dev = [

[project]
name = "llama-index-tools-mcp"
version = "0.2.4"
version = "0.2.5"
description = "llama-index tools mcp integration"
authors = [{name = "Chojan Shang", email = "[email protected]"}]
requires-python = ">=3.10,<4.0"
Expand Down
Loading