Skip to main content

Settings API

This page documents the 6 gateway endpoints tagged Settings in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
GET/get/mcp_semantic_filter_settingsRead the MCP semantic filter settings
PATCH/update/mcp_semantic_filter_settingsChange the MCP semantic filter settings
GET/get/websearch_interception_settingsRead the web search interception settings
PATCH/update/websearch_interception_settingsChange the web search interception settings
GET/get/mcp_tool_search_settingsRead the MCP tool search settings
PATCH/update/mcp_tool_search_settingsChange the MCP tool search settings

Endpoints​

GET /get/mcp_semantic_filter_settings​

Read the MCP semantic filter settings

Shows the MCP semantic filter settings. When the filter is on, the gateway sends a model only the MCP tools most related to the request, ranked by an embedding model, instead of every tool, which keeps prompts short when many tools are connected. The answer carries the stored values and a description of every field for the Admin UI. Proxy admins and admin viewers may read it, other keys get 401, and it changes nothing.

Docs (https://docs.spanway.ai/docs/mcp/tool_filtering#semantic-tool-filter)

Example request:

curl -X GET "http://localhost:4000/get/mcp_semantic_filter_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The stored settings with a description of every fieldapplication/json MCPSemanticFilterSettingsResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
500The gateway runs without a databaseapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
valuesobjectYesValues
field_schemaobjectYesField Schema

PATCH /update/mcp_semantic_filter_settings​

Change the MCP semantic filter settings

Turns the MCP semantic filter on or off and sets its embedding model, how many tools it keeps and the lowest similarity a tool needs. The settings are saved to the database, applied on this instance at once and on every other instance within about ten seconds, and written to the audit log. Only proxy admins may call it.

Docs (https://docs.spanway.ai/docs/mcp/tool_filtering#semantic-tool-filter)

Request body (application/json, schema MCPSemanticFilterSettings):

FieldTypeRequiredDescription
enabledbooleanNoEnable semantic filtering of MCP tools based on query relevance
embedding_modelstringNoEmbedding model to use for semantic similarity (e.g., 'text-embedding-3-small', 'text-embedding-ada-002')
top_kintegerNoNumber of most relevant tools to return
similarity_thresholdnumberNoMinimum similarity score for tool inclusion (0.0 to 1.0, where 1.0 = exact match)

Example request:

curl -X PATCH "http://localhost:4000/update/mcp_semantic_filter_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"embedding_model": "text-embedding-3-small",
"top_k": 20,
"similarity_threshold": 0.3
}'

Responses:

StatusDescriptionBody
200Stored, every instance picks it up within about ten secondsapplication/json SettingsUpdateResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy admin keyapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500store_model_in_db is off, so settings cannot be saved. Set store_model_in_db: true in general_settingsapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesWhat changed
statusstringYesAlways success, failures are reported as HTTP errors
settingsobjectYesThe settings as stored

GET /get/websearch_interception_settings​

Read the web search interception settings

Shows the web search interception settings. When interception is on, the gateway answers a model's web search tool calls itself with a configured search tool, for providers that cannot search on their own. active_on_this_pod says whether the instance that answered applies the setting right now. Proxy admins and admin viewers may read it, other keys get 401, and it changes nothing.

Docs

Example request:

curl -X GET "http://localhost:4000/get/websearch_interception_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The stored settings, their schema and whether this instance applies themapplication/json WebSearchInterceptionSettingsResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
500The gateway runs without a databaseapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
valuesobjectYesValues
field_schemaobjectYesField Schema
active_on_this_podbooleanNoWhether the process answering this request has the interception callback registered. Read-only: it reports what is running here, while values.enabled is the cluster-wide setting, and the two disagree while a pod is still

PATCH /update/websearch_interception_settings​

Change the web search interception settings

Turns web search interception on or off and sets the providers it applies to, the search tool it uses and how many follow-up model calls one request may chain. The settings are saved to the database, applied on this instance at once and on every other instance within about ten seconds, and written to the audit log. Only proxy admins may call it.

Docs

Request body (application/json, schema WebSearchInterceptionSettings):

FieldTypeRequiredDescription
enabledbooleanNoServe web search tool calls from a configured search tool instead of passing them upstream
enabled_providersarray of stringNoLLM providers to intercept for (e.g. 'bedrock', 'vertex_ai'). Empty intercepts Bedrock only.
search_tool_namestring or nullNoName of the configured search tool to run searches through. Empty uses the first one available.
max_agentic_loopsinteger or nullNoHow many follow-up model calls one intercepted request may chain. Empty applies the default of 3.

Example request:

curl -X PATCH "http://localhost:4000/update/websearch_interception_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"enabled_providers": [
"bedrock"
],
"search_tool_name": "web-search",
"max_agentic_loops": 3
}'

Responses:

StatusDescriptionBody
200Stored, every instance picks it up within about ten secondsapplication/json SettingsUpdateResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy admin keyapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500store_model_in_db is off, so settings cannot be saved. Set store_model_in_db: true in general_settingsapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesWhat changed
statusstringYesAlways success, failures are reported as HTTP errors
settingsobjectYesThe settings as stored

GET /get/mcp_tool_search_settings​

Read the MCP tool search settings

Shows how the mcp_tool_search virtual tool ranks the MCP tools a caller may use: the embedding model, how many tools a search returns, the lowest similarity and the core tools that always come first. Proxy admins and admin viewers may read it, other keys get 401, and it changes nothing.

Docs (https://docs.spanway.ai/docs/mcp/tool_filtering#tool-search)

Example request:

curl -X GET "http://localhost:4000/get/mcp_tool_search_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The stored settings with a description of every fieldapplication/json MCPToolSearchSettingsResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
500The gateway runs without a databaseapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
valuesobjectYesValues
field_schemaobjectYesField Schema

PATCH /update/mcp_tool_search_settings​

Change the MCP tool search settings

Changes how the mcp_tool_search virtual tool ranks tools. Leaving out embedding_model keeps keyword matching. The settings are saved to the database, picked up by every instance within about ten seconds and written to the audit log. Only proxy admins may call it.

Docs (https://docs.spanway.ai/docs/mcp/tool_filtering#tool-search)

Request body (application/json, schema MCPToolSearchSettings):

FieldTypeRequiredDescription
embedding_modelstring or nullNoEmbedding model from model_list used to rank tools by meaning. Unset keeps keyword matching.
top_kintegerNoMost ranked tools a search returns. A smaller top_k in the tool call wins. Core tools do not count.
similarity_thresholdnumberNoLowest cosine similarity a tool needs to appear in semantic results (0.0 = no cutoff).
core_toolsarray of stringNoTool names always returned first when the caller can access them, e.g. my_server-get_rates.

Example request:

curl -X PATCH "http://localhost:4000/update/mcp_tool_search_settings" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"embedding_model": "text-embedding-3-small",
"top_k": 5,
"similarity_threshold": 0.2,
"core_tools": [
"billing-get_invoice"
]
}'

Responses:

StatusDescriptionBody
200Stored, every instance picks it up within about ten secondsapplication/json SettingsUpdateResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key is not a proxy admin keyapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500store_model_in_db is off, so settings cannot be saved. Set store_model_in_db: true in general_settingsapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
messagestringYesWhat changed
statusstringYesAlways success, failures are reported as HTTP errors
settingsobjectYesThe settings as stored