APIM Function Generator Snap

Overview

You can use this Snap to convert the APIM service version to the list of functions for the Tool Calling Snap.


Snap Overview

Prerequisites

None.

Limitations and known issues

None.

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap supports 0 or 1 document (Default 1). If the input document contains a tools array, the Snap will append the APIM API tools to this array.
Output

The output contains a list (array) of tools or functions. Each item describes one API or function that can be used.

The output schema includes a set of API functions, each with metadata (such as method, URL, security) and a structured definition of what input parameters (query, body, header) they expect.

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Legend:
  • Expression icon (): JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Account configuration.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

APIM Function Generator

Example: Generate tool calling service
Project path* Expression/Suggestion Required. Specify the path to the project that contains the APIM service used to generate the function definition. Format: project space/project
  • Default value: N/A
  • Example:
Service name* String/Expression/Suggestion

Select the service name from the selected project to convert to functions. The suggestions are listed based on the selected project.

Default value: N/A

Example: PetStore Test

Version*

String/Expression/Suggestion

Select the service version for the service name to convert to functions.. The suggestions are listed based on the selected service name.

Default value: N/A

Example:v1

Base URL

String/Expression/Suggestion

Specify the base URL for the APIM service.

Server

String/Expression

Specify the URL to override the base URL or select the server from the Suggsetions list.

Preferred content type

String/Expression Specify the preferred content type for the APIM service. If you don’t provide one or the type isn’t supported, the Snap selects the first supported content type from the specification.

Filter type

Dropdown

Choose the filter to apply to the service version:

  • Use all paths: All service endpoint paths and methods will be converted to functions
  • Tags: Tags to apply the filter. The Snap includes any path method that contains at least one of the specified tags at the endpoint, path, or method level in the function definition.
  • Paths and methods:
Filter tags Expression/Suggestion

Appears only when Filter type is Tags.

Specify the tag name to filter the service paths.

Note:

You can add multiple tags. Null or blank tag will be filtered out from the tags list to use as a filter.

Filter paths and methods

Use this field set to configure the filter paths and methods. All the specified paths with their associated methods will be included in the tool function list. All the API paths and methods will be converted to the tool functions.

Path

Expression/Suggestion Specify the path of the filter. You can add multiple paths.

Method*

Expression/Suggestion Select the method of the service endpoint path.
Snap execution Dropdown list
Select one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only