IOA / NOA - AI Condition Framework

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

IOA / NOA - AI Condition Framework

IOA / NOA

Previous Top Next


The IOA (If OpenAI) and NOA (Not OpenAI) commands provide a comprehensive AI condition framework for checking states in AI operations, MemoryTools, MCP-Server, and task management.

Syntax

IOA.Subcommand|Parameters

NOA.Subcommand|Parameters

Legacy Syntax (Backward Compatible)

IOA.|$$VAR

IOA.|$$VAR|$$SEARCH

Description

IOA evaluates a condition related to AI operations, memory state, MCP tools, or job status. If the condition is true, the next command is executed. If false, execution skips to the matching JNO (Jump if Not) label.

NOA is the inverse - it executes the next command if the condition is FALSE.

Subcommand Categories

1. MemoryTools Conditions (MEM.)

Check the state of MemoryTools storage.

IOA.MEM.Exists|$$KEY - Returns true if memory key exists

IOA.MEM.Contains|$$KEY|$$SEARCH - True if memory value contains search string

IOA.MEM.Empty|$$KEY - True if memory key exists but is empty

IOA.MEM.Size|$$KEY|>1000 - Compare memory value size (supports >, <, >=, <=, =)

2. AI Response Conditions (AI.)

Check properties of AI responses.

IOA.AI.HasToolCall - True if AI response includes tool calls

IOA.AI.HasFunction|FunctionName - True if specific function was called

IOA.AI.ContentContains|$$SEARCH - True if response content contains text

IOA.AI.FinishReason|stop - True if finish reason matches (stop/length/content_filter)

3. MCP-Server Conditions (MCP.)

Check MCP-Server tool and feature states.

IOA.MCP.ToolExists|ToolName - True if MCP tool is registered

IOA.MCP.ToolEnabled|ToolName - True if MCP tool is enabled

IOA.MCP.HasResult|$$JOBID - True if async job has completed result

IOA.MCP.QueueEmpty - True if MCP command queue is empty

IOA.MCP.FeatureOn|FeatureName - True if MCP feature is enabled

4. Task/Job Conditions (JOB.)

Check status of asynchronous jobs and tasks.

IOA.JOB.Exists|$$JOBID - True if job exists

IOA.JOB.Completed|$$JOBID - True if job completed successfully

IOA.JOB.Failed|$$JOBID - True if job failed

IOA.JOB.Running|$$JOBID - True if job is still running

Parameters

Subcommand: The condition to check (e.g., MEM.Exists, AI.HasToolCall)

Parameters: Varies by subcommand:

$$KEY - Memory key name (for MEM. conditions)

$$SEARCH - String to search for

ToolName - MCP tool name (e.g., MemoryTools::Store)

$$JOBID - Job/task identifier

FeatureName - MCP feature name (e.g., MemoryTools)

Return Value

The condition result is returned via the internal IX register. Use with JNO (Jump if Not) to branch based on the condition.

Examples

Example 1: Check if Memory Key Exists

' Check if last_result exists in memory

IOA.MEM.Exists|last_result

JNO.NoResult

' Process existing result...

MEM.RCL|last_result|$$VALUE

:NoResult

Example 2: Check AI Tool Call

' Check if AI wants to call a tool

IOA.AI.HasToolCall

JNO.NoTool

' Process tool call...

AIG.DoToolCall

GT.End

:NoTool

' Handle direct response...

:End

Example 3: Check MCP Tool Enabled

' Only run if MemoryTools enabled

IOA.MCP.ToolEnabled|MemoryTools::Store

JNO.SkipStore

MCP.Exec|MemoryTools::Store|myKey|myValue

:SkipStore

Example 4: Check Async Job Status

' Check if background job completed

IOA.JOB.Completed|$$JOBID

JNO.NotReady

MCP.CheckResult|$$JOBID|$$RESULT

:NotReady

' Job still running, do other work...

Example 5: Check Memory Content

' Only process if last response doesn't contain "error"

NOA.MEM.Contains|last_response|error

JNO.HasError

' Process successful response...

GT.End

:HasError

' Handle error...

:End

Example 6: Legacy Syntax (Backward Compatible)

' Original IOA behavior - check if variable contains string

IOA.|$$AIResponse|error

JNO.NoError

' Handle error case...

:NoError

Short Aliases

Most subcommands support short aliases for faster typing:

MEM. aliases:

Exists → Ex, E

Contains → Co, C

Empty → Em

Size → Sz, S

AI. aliases:

HasToolCall → Htc, Ht

HasFunction → Hf, Hasfunc

ContentContains → Cc, Contains

FinishReason → Fr, Finish

MCP. aliases:

ToolExists → Te, ToolsExist

ToolEnabled → Ten, ToolEn

HasResult → Hr, Result

QueueEmpty → Qe, QEmpty

FeatureOn → Fo, Feature

JOB. aliases:

Exists → Ex, E

Completed → Co, Complete, Done

Failed → Fa, Fail, Error

Running → Ru, Run, Active

Related Commands

JNO - Jump if Not (conditional branch)

MCP.Memory - MemoryTools operations

AIG - Google Gemini AI commands

AIC - OpenAI commands

MCP - MCP-Server commands

See Also

IEF - If Exists File

IER - If Exists Directory

MEM - Memory commands overview