---
updatedAt: 2026-10-25T15:46:36.000Z
agentTools:
  projectIndex: https://docs.superwise.ai/llms.txt
---

# Test Tool Connection

Test a tool connection.

Parameters:

For `ToolConfigPostgres`:
- **type**: Literal type indication for Postgres tool (`Postgres`).
- **connection_string**: Connection string for the Postgres database.

For `ToolConfigMySQL`:
- **type**: Literal type indication for MySQL tool (`MySQL`).
- **connection_string**: Connection string for the MySQL database.

For `ToolConfigMSSQL`:
- **type**: Literal type indication for MSSQL tool (`MSSQL`).
- **connection_string**: Connection string for the MSSQL database.

For `ToolConfigOracle`:
- **type**: Literal type indication for Oracle tool (`Oracle`).
- **connection_string**: Connection string for the Oracle database.

For `ToolConfigBigQuery`:
- **type**: Literal type indication for BigQuery tool (`BigQuery`).
- **project_id**: Project ID for BigQuery.
- **dataset_id**: Dataset ID for BigQuery.
- **service_account**: Service account information as a dictionary with keys and values as strings.

For `ToolConfigPGVector`:
- **type**: Literal type indication for PG Vector tool (`PGVector`).
- **connection_string**: Connection string for the PG Vector database.
- **table_name**: Name of the table in the PG Vector database.
- **embedding_model**: Configuration of the embedding model to be used.
    - **provider**: Provider of the embedding model (`VertexAIModelGarden`).
    - **project_id**: Project ID for Vertex AI.
    - **endpoint_id**: Endpoint ID for the model.
    - **location**: Location of the Vertex AI endpoint.
    - **service_account**: Service account information as a dictionary with keys and values as strings.

Tests the connection for a tool an agent can use. Supported tools are SQL databases (Postgres, MySQL, MSSQL, and Oracle), BigQuery, vector stores (PGVector and Pinecone), OpenAPI tools, MCP servers, and knowledge.

## When to use it

Use it to validate connection details and credentials before you add the tool to an agent version.

## Required parameters

* Request body: the tool configuration. Its `type` selects the tool, and the remaining fields are that tool's settings, such as a `connection_string` for a SQL database.

## Response

A successful call returns `204 No Content` with an empty body.

**Related:** [Test a model connection](https://docs.superwise.ai/reference/test_model_connection), [Test MCP connectivity](https://docs.superwise.ai/reference/test_mcp_connectivity), [Create an agent version](https://docs.superwise.ai/reference/create_version)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "paths": {
    "/v1/agents/test-tool-connection": {
      "post": {
        "tags": [
          "Agents"
        ],
        "summary": "Test Tool Connection",
        "description": "Test a tool connection.\n\nParameters:\n\nFor `ToolConfigPostgres`:\n- **type**: Literal type indication for Postgres tool (`Postgres`).\n- **connection_string**: Connection string for the Postgres database.\n\nFor `ToolConfigMySQL`:\n- **type**: Literal type indication for MySQL tool (`MySQL`).\n- **connection_string**: Connection string for the MySQL database.\n\nFor `ToolConfigMSSQL`:\n- **type**: Literal type indication for MSSQL tool (`MSSQL`).\n- **connection_string**: Connection string for the MSSQL database.\n\nFor `ToolConfigOracle`:\n- **type**: Literal type indication for Oracle tool (`Oracle`).\n- **connection_string**: Connection string for the Oracle database.\n\nFor `ToolConfigBigQuery`:\n- **type**: Literal type indication for BigQuery tool (`BigQuery`).\n- **project_id**: Project ID for BigQuery.\n- **dataset_id**: Dataset ID for BigQuery.\n- **service_account**: Service account information as a dictionary with keys and values as strings.\n\nFor `ToolConfigPGVector`:\n- **type**: Literal type indication for PG Vector tool (`PGVector`).\n- **connection_string**: Connection string for the PG Vector database.\n- **table_name**: Name of the table in the PG Vector database.\n- **embedding_model**: Configuration of the embedding model to be used.\n    - **provider**: Provider of the embedding model (`VertexAIModelGarden`).\n    - **project_id**: Project ID for Vertex AI.\n    - **endpoint_id**: Endpoint ID for the model.\n    - **location**: Location of the Vertex AI endpoint.\n    - **service_account**: Service account information as a dictionary with keys and values as strings.",
        "operationId": "test_tool_connection",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ToolConfigPGVector"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigPineconeVectorDB"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigSQLDatabasePostgres"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigSQLDatabaseMySQL"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigSQLDatabaseMSSQL"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigSQLDatabaseOracle"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigBigQuery"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigOpenAPI"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigMCP-Input"
                  },
                  {
                    "$ref": "#/components/schemas/ToolConfigKnowledge"
                  }
                ],
                "title": "Payload",
                "discriminator": {
                  "propertyName": "type",
                  "mapping": {
                    "PGVector": "#/components/schemas/ToolConfigPGVector",
                    "Pinecone": "#/components/schemas/ToolConfigPineconeVectorDB",
                    "PostgreSQL": "#/components/schemas/ToolConfigSQLDatabasePostgres",
                    "MySQL": "#/components/schemas/ToolConfigSQLDatabaseMySQL",
                    "MSSQL": "#/components/schemas/ToolConfigSQLDatabaseMSSQL",
                    "Oracle": "#/components/schemas/ToolConfigSQLDatabaseOracle",
                    "BigQuery": "#/components/schemas/ToolConfigBigQuery",
                    "OpenAPI": "#/components/schemas/ToolConfigOpenAPI",
                    "MCP": "#/components/schemas/ToolConfigMCP-Input",
                    "Knowledge": "#/components/schemas/ToolConfigKnowledge"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Unprocessable Entity"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    }
  },
  "info": {
    "title": "Superwise Main Entities",
    "description": "API reference",
    "version": "0.1.0"
  },
  "components": {
    "schemas": {
      "BearerAuthenticationConfig": {
        "properties": {
          "type": {
            "type": "string",
            "const": "Bearer",
            "title": "Type"
          },
          "token": {
            "type": "string",
            "title": "Token"
          }
        },
        "type": "object",
        "required": [
          "type",
          "token"
        ],
        "title": "BearerAuthenticationConfig"
      },
      "EmbeddingModel": {
        "properties": {
          "provider_id": {
            "type": "string",
            "title": "Provider Id"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "type": "object",
        "required": [
          "provider_id"
        ],
        "title": "EmbeddingModel"
      },
      "FileKnowledgeMetadata": {
        "properties": {
          "type": {
            "type": "string",
            "const": "file",
            "title": "Type",
            "default": "file"
          },
          "file_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "File Ids"
          }
        },
        "type": "object",
        "required": [
          "file_ids"
        ],
        "title": "FileKnowledgeMetadata"
      },
      "MCPToolSchema": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "inputSchema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inputschema"
          },
          "annotations": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Annotations"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "MCPToolSchema",
        "description": "Minimal MCP tool schema for StructuredTool conversion"
      },
      "ToolConfigBigQuery": {
        "properties": {
          "type": {
            "type": "string",
            "const": "BigQuery",
            "title": "Type",
            "default": "BigQuery"
          },
          "config_metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ToolConfigSQLMetadata"
              },
              {
                "type": "null"
              }
            ]
          },
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "dataset_id": {
            "type": "string",
            "title": "Dataset Id"
          },
          "service_account": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Service Account"
          }
        },
        "type": "object",
        "required": [
          "project_id",
          "dataset_id",
          "service_account"
        ],
        "title": "ToolConfigBigQuery"
      },
      "ToolConfigKnowledge": {
        "properties": {
          "type": {
            "type": "string",
            "const": "Knowledge",
            "title": "Type",
            "default": "Knowledge"
          },
          "knowledge_id": {
            "type": "string",
            "title": "Knowledge Id"
          },
          "knowledge_metadata": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/UrlKnowledgeMetadata"
                  },
                  {
                    "$ref": "#/components/schemas/FileKnowledgeMetadata"
                  }
                ],
                "discriminator": {
                  "propertyName": "type",
                  "mapping": {
                    "file": "#/components/schemas/FileKnowledgeMetadata",
                    "url": "#/components/schemas/UrlKnowledgeMetadata"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "title": "Knowledge Metadata",
            "hidden": true
          },
          "embedding_model": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmbeddingModel"
              },
              {
                "type": "null"
              }
            ],
            "hidden": true
          }
        },
        "type": "object",
        "required": [
          "knowledge_id"
        ],
        "title": "ToolConfigKnowledge"
      },
      "ToolConfigMCP-Input": {
        "properties": {
          "type": {
            "type": "string",
            "const": "MCP",
            "title": "Type",
            "default": "MCP"
          },
          "transport": {
            "type": "string",
            "const": "streamable_http",
            "title": "Transport",
            "default": "streamable_http"
          },
          "mcp_id": {
            "type": "string",
            "format": "uuid4",
            "title": "Mcp Id",
            "description": "MCP entity ID (UUID)"
          },
          "tool_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Name",
            "description": "Specific tool name to use from MCP entity"
          },
          "tool_schema": {
            "items": {
              "$ref": "#/components/schemas/MCPToolSchema"
            },
            "type": "array",
            "minItems": 1,
            "title": "Tool Schema",
            "description": "Tool schema(s) from MCP entity"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "MCP server URL from MCP entity"
          },
          "headers": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Headers",
            "description": "Headers from MCP entity"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params",
            "description": "Query params from MCP entity"
          }
        },
        "type": "object",
        "required": [
          "mcp_id",
          "tool_schema"
        ],
        "title": "ToolConfigMCP"
      },
      "ToolConfigOpenAPI": {
        "properties": {
          "type": {
            "type": "string",
            "const": "OpenAPI",
            "title": "Type",
            "default": "OpenAPI"
          },
          "openapi_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Openapi Schema"
          },
          "authentication": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BearerAuthenticationConfig"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "openapi_schema"
        ],
        "title": "ToolConfigOpenAPI"
      },
      "ToolConfigPGVector": {
        "properties": {
          "type": {
            "type": "string",
            "const": "PGVector",
            "title": "Type",
            "default": "PGVector"
          },
          "connection_string": {
            "type": "string",
            "title": "Connection String"
          },
          "table_name": {
            "type": "string",
            "title": "Table Name"
          },
          "db_schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Db Schema"
          },
          "embedding_model": {
            "$ref": "#/components/schemas/EmbeddingModel"
          }
        },
        "type": "object",
        "required": [
          "connection_string",
          "table_name",
          "embedding_model"
        ],
        "title": "ToolConfigPGVector"
      },
      "ToolConfigPineconeVectorDB": {
        "properties": {
          "type": {
            "type": "string",
            "const": "Pinecone",
            "title": "Type",
            "default": "Pinecone"
          },
          "api_key": {
            "type": "string",
            "title": "Api Key"
          },
          "index_name": {
            "type": "string",
            "title": "Index Name"
          },
          "embedding_model": {
            "$ref": "#/components/schemas/EmbeddingModel"
          }
        },
        "type": "object",
        "required": [
          "api_key",
          "index_name",
          "embedding_model"
        ],
        "title": "ToolConfigPineconeVectorDB"
      },
      "ToolConfigSQLDatabaseMSSQL": {
        "properties": {
          "type": {
            "type": "string",
            "const": "MSSQL",
            "title": "Type",
            "default": "MSSQL"
          },
          "config_metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ToolConfigSQLMetadata"
              },
              {
                "type": "null"
              }
            ]
          },
          "connection_string": {
            "type": "string",
            "pattern": "^mssql://",
            "title": "Connection String"
          }
        },
        "type": "object",
        "required": [
          "connection_string"
        ],
        "title": "ToolConfigSQLDatabaseMSSQL"
      },
      "ToolConfigSQLDatabaseMySQL": {
        "properties": {
          "type": {
            "type": "string",
            "const": "MySQL",
            "title": "Type",
            "default": "MySQL"
          },
          "config_metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ToolConfigSQLMetadata"
              },
              {
                "type": "null"
              }
            ]
          },
          "connection_string": {
            "type": "string",
            "pattern": "^mysql://",
            "title": "Connection String"
          }
        },
        "type": "object",
        "required": [
          "connection_string"
        ],
        "title": "ToolConfigSQLDatabaseMySQL"
      },
      "ToolConfigSQLDatabaseOracle": {
        "properties": {
          "type": {
            "type": "string",
            "const": "Oracle",
            "title": "Type",
            "default": "Oracle"
          },
          "config_metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ToolConfigSQLMetadata"
              },
              {
                "type": "null"
              }
            ]
          },
          "connection_string": {
            "type": "string",
            "pattern": "^oracle://",
            "title": "Connection String"
          }
        },
        "type": "object",
        "required": [
          "connection_string"
        ],
        "title": "ToolConfigSQLDatabaseOracle"
      },
      "ToolConfigSQLDatabasePostgres": {
        "properties": {
          "type": {
            "type": "string",
            "const": "PostgreSQL",
            "title": "Type",
            "default": "PostgreSQL"
          },
          "config_metadata": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ToolConfigSQLMetadata"
              },
              {
                "type": "null"
              }
            ]
          },
          "connection_string": {
            "type": "string",
            "pattern": "^postgresql://",
            "title": "Connection String"
          }
        },
        "type": "object",
        "required": [
          "connection_string"
        ],
        "title": "ToolConfigSQLDatabasePostgres"
      },
      "ToolConfigSQLMetadata": {
        "properties": {
          "include_tables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Include Tables"
          },
          "exclude_tables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude Tables"
          }
        },
        "type": "object",
        "title": "ToolConfigSQLMetadata"
      },
      "UrlKnowledgeMetadata": {
        "properties": {
          "type": {
            "type": "string",
            "const": "url",
            "title": "Type",
            "default": "url"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "max_depth": {
            "type": "integer",
            "maximum": 5,
            "minimum": 1,
            "title": "Max Depth"
          }
        },
        "type": "object",
        "required": [
          "url",
          "max_depth"
        ],
        "title": "UrlKnowledgeMetadata"
      }
    },
    "securitySchemes": {
      "implicit": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://authentication.superwise.ai/identity/resources/auth/v1/api-token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "implicit": []
    }
  ],
  "servers": [
    {
      "url": "api.superwise.ai",
      "description": "Superwise Api Gateway"
    }
  ]
}
```