Skip to content

Commit 2f46d42

Browse files
committed
update doc configurations
1 parent 0ada88c commit 2f46d42

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/tools/functions_as_tools.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,32 @@ In this example:
6767

6868
If these custom options are not provided, the MCP tool name might default to a derivative of the function's FQN, and the description might be generic and cannot help AI Agent to understand the purpose of the MCP tool.
6969

70+
## Server-Side Configuration via Environment Variables
71+
72+
Beyond customizing individual tool properties at the function deployment level, you can also configure the overall behavior of the "Functions as Tools" feature on the StreamNative MCP Server side using the following environment variables. These variables are typically set when starting the MCP server.
73+
74+
* `PULSAR_FUNCTIONS_POLL_INTERVAL`
75+
* **Description**: Controls how frequently the MCP Server polls the Pulsar cluster to discover or update available Pulsar Functions. Setting a lower value means functions are discovered faster, but it may increase the load on the Pulsar cluster.
76+
* **Unit**: Seconds
77+
* **Default**: Defaults to the value specified in `pftools.DefaultManagerOptions()`. Refer to the `pkg/pftools` package for the precise default (e.g., if the internal default is 60 seconds, it will be `60`).
78+
* `PULSAR_FUNCTIONS_TIMEOUT`
79+
* **Description**: Sets the default timeout for invoking a Pulsar Function as an MCP tool. If a function execution exceeds this duration, the call will be considered timed out.
80+
* **Unit**: Seconds
81+
* **Default**: Defaults to the value specified in `pftools.DefaultManagerOptions()` (e.g., if the internal default is 30 seconds, it will be `30`).
82+
* `PULSAR_FUNCTIONS_FAILURE_THRESHOLD`
83+
* **Description**: Defines the number of consecutive failures for a specific Pulsar Function tool before it is temporarily moved to a "circuit breaker open" state. In this state, further calls to this specific function tool will be immediately rejected without attempting to execute the function, until the `PULSAR_FUNCTIONS_RESET_TIMEOUT` is reached.
84+
* **Unit**: Integer (number of failures)
85+
* **Default**: Defaults to the value specified in `pftools.DefaultManagerOptions()` (e.g., if the internal default is 5, it will be `5`).
86+
* `PULSAR_FUNCTIONS_RESET_TIMEOUT`
87+
* **Description**: Specifies the duration for which a Pulsar Function tool remains in the "circuit breaker open" state (due to exceeding the failure threshold) before the MCP server attempts to reset the circuit and allow calls again.
88+
* **Unit**: Seconds
89+
* **Default**: Defaults to the value specified in `pftools.DefaultManagerOptions()` (e.g., if the internal default is 60 seconds, it will be `60`).
90+
* `PULSAR_FUNCTIONS_TENANT_NAMESPACES`
91+
* **Description**: A comma-separated list of Pulsar `tenant/namespace` strings that the MCP Server should scan for Pulsar Functions. This allows you to restrict function discovery to specific namespaces. If not set, the server might attempt to discover functions from all namespaces it has access to, as permitted by its Pulsar client configuration.
92+
* **Format**: `tenant1/namespace1,tenant2/namespace2`
93+
* **Example**: `public/default,my-tenant/app-functions`
94+
* **Default**: Empty (meaning discover from all accessible namespaces (only on StreamNative Cloud)).
95+
7096
## Considerations and Limitations
7197

7298
* **Schema Definition**: For reliable schema conversion, ensure your Pulsar Functions have clearly defined input and output schemas using Pulsar's schema registry capabilities. Functions with ambiguous or `BYTES` schemas might not be converted effectively or might default to generic byte array inputs/outputs.

0 commit comments

Comments
 (0)