call_subroutine
Execute cataloged BASIC subroutines with arguments by reference, returning output arguments for MultiValue database operations.
Instructions
Call a cataloged BASIC subroutine with arguments.
Executes a cataloged BASIC program and returns the results. Arguments are passed by reference, so output arguments will be returned in the response.
Args: name: Name of the cataloged subroutine args: List of argument values to pass (input arguments). Arguments are passed as strings and converted by the subroutine. num_args: Total number of arguments the subroutine expects. If not specified, uses len(args). Required if subroutine has output-only arguments.
Returns: Dictionary containing: - status: success or error - args_out: List of argument values after subroutine execution - original_args: The input arguments that were passed
Example: # Call GET.CUSTOMER.DATA with customer ID, returns data in args 2-3 call_subroutine("GET.CUSTOMER.DATA", ["CUST001", "", ""], num_args=3)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>"
},
"name": "call_subroutine"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | ||
| name | Yes | ||
| num_args | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||