Agentic evaluation parser tool

  • Release version: Zurich
  • Updated August 19, 2025
  • 3 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Agentic Evaluation Parser Tool

    The Agentic Evaluation Parser Tool helps ServiceNow customers extract structured execution data from AI agent or agentic workflow execution logs. This data can be used to create custom metrics by scripting specific criteria to evaluate the effectiveness and performance of AI agents and workflows.

    Show full answer Show less

    The tool returns structured output within the output.payload object, which includes:

    • executionInputs: Initial workflow setup details such as agent and tool names, instructions, and initial user utterance.
    • executionOutputs: Actions taken by AI agents and results from tool executions.
    • executionMessages: A sequence of user-facing conversation messages and system responses.
    • executionPlanDetails: Metadata about the execution like status, configuration, and related task identifiers.

    Accessing and Using the Parser Tool Output

    To access the full parser tool output for testing and development:

    • Go to the Script Editor view in your custom metric guided setup.
    • Select Run Test and wait for completion.
    • Review the complete JSON output under the Tools section of the test results.

    This step allows you to inspect the data structure before implementing custom evaluation logic.

    Data Structures Explained

    • executionInputs: Contains the workflow name, description, instructions, initial user utterance, and a list of agents with their respective tools and execution modes (Autonomous or Supervised).
    • executionOutputs: Lists agents’ actions, subtasks, and tool execution outputs.
    • executionMessages: Ordered messages exchanged between agents and users, useful for understanding conversation flow.
    • executionPlanDetails: Provides execution metadata such as current state, run type (e.g., API, Chat, Evaluation), related task IDs, and context for tracking and debugging.

    Implementing Custom Metrics

    Within a custom metric script, the parser tool output is accessed via the context parameter. You can parse and extract the structured data using the provided code snippet, enabling you to analyze inputs, outputs, messages, and execution metadata programmatically.

    This capability empowers you to define tailored criteria that measure AI agent effectiveness and workflow performance, enhancing your ability to monitor and improve agentic workflows within ServiceNow.

    Use the outputs of the agentic evaluation parser tool in your scripts for custom metrics to customize the criteria for effective AI agents and agentic workflows.

    Parser tool overview

    The agentic evaluation parser tool extracts structured execution data from the execution logs of an agentic workflow or AI agent. You can use the information gathered by the tool to create custom metrics that use scripts to evaluate agentic workflows.

    The parser tool returns structured AI agent or agentic workflow execution data within the output.payload object, which contains the following:

    • executionInputs: A JSON object that contains initial workflow setup information, such as the names and instructions of agents and tools and the initial user utterance
    • executionOutputs: A JSON object with AI agent actions and tool execution results
    • executionMessages: A JSON object array of user-facing conversation flow and system responses
    • executionPlanDetails: A JSON object of execution metadata, such as status, sys_ids, and configuration values
    {
         "output": {
     "payload": {
      "executionInputs": { ... },
      "executionOutputs": { ... },
      "executionMessages": [ ... ],
      "executionPlanDetails": { ... }
     }
    }
    

    Accessing the parser tool's output

    To view the complete parser tool output for testing and development, perform the following steps.

    • Navigate to the Script Editor view in your custom metric guided setup.
    • Select Run Test.
    • Wait for the test to complete.
    • View the complete JSON output in the Tools section of the test results.

    Reviewing the parser tool's output before designing your custom metric enables you to inspect the data structure before implementing any specific logic.

    executionInputs data structure

    The executionInputs attribute contains a JSON object with the following structure:

    "executionInputs": {
     "agenticWorkflow": "(name of agentic workflow)",
     "description": "(descriptions for agentic workflow)",
     "instructions": "(list of steps for agentic workflow)", 
     "utterance": "(initial user utterance)", 
     "agents": [ 
      { 
       "name": "(AI agent name)",  
       "instructions": "(list of steps for AI agent)", 
       "tools": [ 
        { 
         "name": "(tool name)", 
         "description": "(tool description)", 
         "executionMode": "(execution mode, either Autonomous or Supervised)", 
         "inputs": { ... } 
        }, 
        { ... }, ... 
       ]
      }, 
      { ... }, ... 
     ]
    }

    executionOutputs data structure

    The executionOutputs attribute contains a JSON object with the following structure:

    "executionOutputs": {
     "agents": [ 
      { 
       "name": "(AI agent name)", 
       "subTask": { ... }, 
       "tools": [ 
        { 
         "name": "(tool name)", 
         "inputs": { ... }, 
         "output": { ... }
        }
       ]
      }, 
      { ... }, ... 
     ]
    }

    executionMessages data structure

    The executionOutputs attribute contains an array of JSON objects with the following structure:

    "executionMessages": [ 
     { 
      "role": "(Message sender, either 'agent' or 'user')", 
       "message": "(Content of message)", 
       "order": "(Sequence number indicating order of message in the conversation)"
      }, 
      { ... }, ... 
    ]
       

    executionPlanDetails data structure

    The executionPlanDetails attribute contains a JSON object with the following structure:

    "executionPlanDetails": { 
        "state": "(Current execution status)", 
        "runType": "(Type of execution)", 
        "conversationId": "(sys_id of conversation)", 
        "relatedTask": "(sys_id of the associated task or record)", 
        "relatedTaskTable": "(Table name where the related task is stored)", 
        "context": { ... } (May be null)
        "builtInTools": [ { ... } ]
        }
       

    This section provides execution metadata for tracking workflow performance, debugging issues, and correlating executions with specific tasks or conversations.

    The possibilities for runType include the following:

    • API
    • Chat
    • Evaluation
    • Testing
    • Trigger

    Using parser tool output in metric scripts

    The parser tool data is available in your metric script through the context parameter. Access the structured data using the following code:

    // Access the parser tool output from context
    var parserToolOutput = context['AgenticExecutionParserTool.output'];
    if (typeof parserToolOutput == "string") {
     parserToolOutput = JSON.parse(parserToolOutput);
    }
    var parserToolPayload = parserToolOutput.payload;
    var parserToolStatus = parserToolOutput.status;
        
    // Extract individual sections from payload
    var inputs = parserToolPayload.executionInputs;
    var outputs = parserToolPayload.executionOutputs;
    var messages = parserToolPayload.executionMessages;
    var planDetails = parserToolPayload.executionPlanDetails;