Skip to content

Task Definitions

This document describes the YAML configuration required for each task type in the system.

MFO API Tasks

mfo_api_chat_send

Sends a message to the MFO Chat API.

type: mfo_api_chat_send
description: string  # a short description
config:
  # Exactly one of these must be provided:
  prompt_template_id: string  # ID of the prompt template to use
  prompt: string             # Raw prompt text to send (must be non-empty if used)

  # Optional parameters:
  prompt_context:            # Context variables for template rendering
    key1: value1
    key2: value2
  include_tools: boolean     # Whether to include client tools
  include_server_tools: boolean  # Whether to include server tools
  system_prompt: string      # Override system prompt
  provider_id: string        # Provider ID for the chat
  model_id: string          # Model ID to use
  thread_id: string         # Thread ID to continue conversation
  options:                  # Additional options for the chat request
    key1: value1
    key2: value2
  error_handling:           # Error handling configuration
    on_error:
      - type: retry_with_prompt
        append_to_system_prompt: string
        max_retries: number

Notes: - You must provide either prompt_template_id or prompt, but not both - If using prompt, it must be a non-empty string - If using prompt_template_id, the template must exist in the loaded prompts - When using prompt_template_id, the template's provider and model settings will be used if not overridden - The task will automatically handle tool calls if the prompt template includes tools - Error handling can be configured to retry with modified prompts on failure

mfo_api_chat_get_history

Retrieves chat history for a specific thread.

type: mfo_api_chat_get_history
description: string  # a short description
config:
  thread_id: string  # Required: ID of the thread to get history for

mfo_api_tool_execute

Executes a tool via the MFO API.

type: mfo_api_tool_execute
description: string  # a short description
config:
  tool_id: string           # Required: ID of the tool to execute
  arguments:                # Required: Arguments for the tool
    key1: value1
    key2: value2
  provider_id: string       # Optional: Provider ID for the tool execution

Notes: - The tool_id must be a valid tool ID that exists in the system - The arguments must match the expected arguments for the specified tool - If provider_id is not specified, the default provider will be used

mfo_api_memory_store

Stores a value in the MFO Memory system.

type: mfo_api_memory_store
description: string  # a short description
config:
  key: string              # Required: Key to store the value under
  value: any               # Required: Value to store
  provider_id: string      # Optional: Provider ID for the memory operation

Notes: - The key must be a non-empty string - The value can be any valid JSON-serializable value - If provider_id is not specified, the default provider will be used

mfo_api_memory_get

Retrieves a value from the MFO Memory system.

type: mfo_api_memory_get
description: string  # a short description
config:
  key: string              # Required: Key to retrieve
  provider_id: string      # Optional: Provider ID for the memory operation

Notes: - The key must be a non-empty string - If provider_id is not specified, the default provider will be used - Returns the stored value in the task output under the key "value"

mfo_api_memory_delete

Deletes a value from the MFO Memory system.

type: mfo_api_memory_delete
description: string  # a short description
config:
  key: string              # Required: Key to delete
  provider_id: string      # Optional: Provider ID for the memory operation

Notes: - The key must be a non-empty string - If provider_id is not specified, the default provider will be used

mfo_api_resource_list

Lists resources from the MFO API.

type: mfo_api_resource_list
description: string  # a short description
config:
  provider_id: string      # Optional: Provider ID to list resources from
  resource_type: string    # Optional: Type of resources to list

Notes: - If provider_id is not specified, resources from all providers will be listed - If resource_type is not specified, all resource types will be listed - Returns a list of resources in the task output under the key "resources"

mfo_api_resource_create

Creates a new resource in the MFO API.

type: mfo_api_resource_create
description: string  # a short description
config:
  resource_type: string    # Required: Type of resource to create
  properties:              # Required: Properties of the resource
    key1: value1
    key2: value2
  provider_id: string      # Optional: Provider ID to create the resource in

Notes: - The resource_type must be a valid resource type - The properties must match the expected properties for the specified resource type - If provider_id is not specified, the default provider will be used - Returns the created resource in the task output under the key "resource"

mfo_api_resource_get

Retrieves a resource from the MFO API.

type: mfo_api_resource_get
description: string  # a short description
config:
  resource_id: string      # Required: ID of the resource to retrieve
  provider_id: string      # Optional: Provider ID of the resource

Notes: - The resource_id must be a valid resource ID - If provider_id is not specified, the default provider will be used - Returns the resource in the task output under the key "resource"

mfo_api_resource_delete

Deletes a resource from the MFO API.

type: mfo_api_resource_delete
description: string  # a short description
config:
  resource_id: string      # Required: ID of the resource to delete
  provider_id: string      # Optional: Provider ID of the resource

Notes: - The resource_id must be a valid resource ID - If provider_id is not specified, the default provider will be used

mfo_api_job_create

Creates a new job in the MFO API.

type: mfo_api_job_create
description: string  # a short description
config:
  job_type: string         # Required: Type of job to create
  parameters:              # Required: Parameters for the job
    key1: value1
    key2: value2
  provider_id: string      # Optional: Provider ID to create the job in

Notes: - The job_type must be a valid job type - The parameters must match the expected parameters for the specified job type - If provider_id is not specified, the default provider will be used - Returns the created job in the task output under the key "job"

mfo_api_job_get

Retrieves a job from the MFO API.

type: mfo_api_job_get
description: string  # a short description
config:
  job_id: string          # Required: ID of the job to retrieve
  provider_id: string     # Optional: Provider ID of the job

Notes: - The job_id must be a valid job ID - If provider_id is not specified, the default provider will be used - Returns the job in the task output under the key "job"

Output Variables

Each task stores its output in the task context under its ID. Here's what each task outputs:

  • mfo_api_chat_send:
  • message: The chat message response
  • thread_id: The thread ID for the conversation
  • parsed_content: If the message content is valid JSON, the parsed content

  • mfo_api_chat_get_history:

  • messages: Array of chat messages in the thread

  • mfo_api_tool_execute:

  • result: The result of the tool execution

  • mfo_api_memory_store:

  • success: Boolean indicating if the store operation was successful

  • mfo_api_memory_get:

  • value: The retrieved value

  • mfo_api_memory_delete:

  • success: Boolean indicating if the delete operation was successful

  • mfo_api_resource_list:

  • resources: Array of resources

  • mfo_api_resource_create:

  • resource: The created resource

  • mfo_api_resource_get:

  • resource: The retrieved resource

  • mfo_api_resource_delete:

  • success: Boolean indicating if the delete operation was successful

  • mfo_api_job_create:

  • job: The created job

  • mfo_api_job_get:

  • job: The retrieved job