Skip to main content
Glama
florinel-chis

Multi-Source Documentation MCP Server

tests.md7.78 kB
--- category: general scraped_at: '2025-11-12T14:10:01.489027' title: Interaction-Based Tests Reference url: /docs/tests --- # Interaction-Based Tests Reference ## Overview Test the conversation flow with **predefined interactions** where you send specific user utterances to your agent and validate exact responses. ## Reference A traditional test is a YAML file with the following structure: YAML ``` # test.yaml # Name of the test. name: Example test # Brief description of the test. description: These are some tests # A interactions is the test itself: given an input, you will validate the agent response returned by Voiceflow # You can have multiple interactions defined interactions: # The ID of the interactions - id: test_1 user: # the input type # it could be text, audio or prompt type: text # The input itself in text format. For type: audio, you have to specify the audio file. text: I want 3 pizzas agent: validate: # String validation to check if the response returned by Voiceflow is correct - type: contains value: pizza - id: test_2 user: type: text text: hi agent: # example with a traceType validation validate: - type: traceType value: speak - id: test_3 user: type: text audio: hello agent: # example with a regexp validation validate: - type: regexp value: '/my-regex/' - id: test_4 user: type: text audio: hello agent: # example with a similarity validation validate: - type: similarity similarityConfig: provider: 'openai' model: 'gpt-4o' temperature: 0.8 top_k: 5 top_p: 0.9 similarityThreshold: 0.5 values: - 'hi' - 'Hello' - id: test_5 user: type: text text: 'myVariableValue1' agent: # example with a variable validation validate: - type: variable value: 'myVariableValue1' variableConfig: name: 'variableName1' ``` ## Input types ### Text input The input text is the simplest one. You just have to specify the text you want to send to Voiceflow. Make sure that the text is in the language you specified in the `localeId` field. to use this type you have to set the `type` field to `text` and the `text` field to the text you want to send. ## Validation types ### Contains The contains validation type is the simplest one. It just checks if the response returned by the Voiceflow agent contains the value specified in the `value` field. To use this type you have to set the `type` field to `contains` and the `value` field to the value you want to check: YAML ``` validate: # String validation to check if the response returned by Voiceflow is correct - type: contains value: pizza ``` ### Equals The equals validation type is a little bit more complex. It checks if the response returned by the Voiceflow agent is equal to the value specified in the `value` field. To use this type you have to set the `type` field to `equals` and the `value` field to the value you want to check: YAML ``` validate: # String validation to check if the response returned by Voiceflow is correct - type: equals value: Here you have 3 pizzas ``` ### Regexp The regexp validation type is the most complex one. It checks if the response returned by the Voiceflow agent matches the regexp specified in the `value` field. To use this type you have to set the `type` field to `regexp` and the `value` field to the regular expression you want to check: YAML ``` validate: # String validation to check if the response returned by Voiceflow is correct - type: regexp value: '/Here you have \d pizzas/' ``` ### TraceType The traceType validation type checks if the response returned by the Voiceflow agent has the trace type specified in the `value` field. To use this type you have to set the `type` field to `traceType` and the `value` field to the trace type you want to check: YAML ``` validate: # String validation to check if the response returned by Voiceflow is correct - type: traceType value: speak ``` ### Similarity The similarity validation type checks if the response returned by the Voiceflow agent is similar to the values specified in the `values` field. To use this type you have to set the `type` field to `similarity` and the `values` field to the values you want to check: YAML ``` validate: # String validation to check if the response returned by Voiceflow is correct - type: similarity similarityConfig: provider: 'openai' model: 'gpt-4o' temperature: 0.8 top_k: 5 top_p: 0.9 similarityThreshold: 0.5 values: - 'hi' - 'Hello' ``` You can also use the `similarityConfig` field to specify the similarity configuration. The `provider` field specifies the similarity provider you want to use. The `model` field specifies the model you want to use. The `temperature` field specifies the temperature you want to use. The `top_k` field specifies the top k you want to use. The `top_p` field specifies the top p you want to use. The `similarityThreshold` field specifies the similarity threshold you want to use. The only provider available for now is `openai`. For LLM Providers authentication please check the [Authentication](/overview/authentication) page. ### Variable The variable validation type checks if a variable in the Voiceflow agent has the expected value. To use this type you have to set the `type` field to `variable`, the `value` field to the expected value, and provide a `variableConfig` object with the variable details: YAML ``` validate: # Variable validation to check if a variable has the expected value - type: variable value: 'myVariableValue1' variableConfig: name: 'variableName1' ``` The `variableConfig` object accepts the following properties: * `name`: (Required) The name of the variable to validate * `jsonPath`: (Optional) A JSONPath expression to extract nested values from JSON/object variables Examples: YAML ``` validate: # Simple variable validation - type: variable value: 'myVariableValue1' variableConfig: name: 'variableName1' # Multiple variable validations - type: variable value: 'myVariableValue2' variableConfig: name: 'variableName2' # Variable validation with JSONPath if the variable is a JSON/object - type: variable value: 'myVariableValue3' variableConfig: name: 'variableName3' jsonPath: '$.hello' ``` ## JSON Schema `voiceflow-cli` also has a [jsonschema](http://json-schema.org/draft/2020-12/json-schema-validation.html) file, which you can use to have better editor support: Shell ``` https://voiceflow.xavidop.me/static/conversationtest.json ``` You can also specify it in your `yml` config files by adding a comment like the following: YAML ``` # yaml-language-server: $schema=https://voiceflow.xavidop.me/static/conversationtest.json ``` YAML ``` # yaml-language-server: $schema=https://voiceflow.xavidop.me/static/conversationtest.json ``` Updated 4 months ago --- [Suite Reference](/docs/suites)[Interaction-Based Examples](/docs/contains) Ask AI * [Table of Contents](#) * + [Overview](#overview) + [Reference](#reference) + [Input types](#input-types) + - [Text input](#text-input) + [Validation types](#validation-types) + - [Contains](#contains) - [Equals](#equals) - [Regexp](#regexp) - [TraceType](#tracetype) - [Similarity](#similarity) - [Variable](#variable) + [JSON Schema](#json-schema)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/florinel-chis/voiceflow-doc-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server