Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Beta.Connectors

Overview

(beta) Connectors API - manage your connectors

Available Operations

create

Create a new MCP connector. You can customize its visibility, url and auth type.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.create(name="<value>", description="unibody usually despite slushy wherever reward stingy from", server="https://royal-majority.net/")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
name str ✔️ The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes.
description str ✔️ The description of the connector.
server str ✔️ The url of the MCP server.
title OptionalNullable[str] Optional human-readable title for the connector.
icon_url OptionalNullable[str] The optional url of the icon you want to associate to the connector.
visibility Optional[models.ResourceVisibility] N/A
headers Dict[str, Any] Optional organization-level headers to be sent with the request to the mcp server.
auth_data OptionalNullable[models.AuthData] Optional additional authentication data for the connector.
oauth2_server_metadata OptionalNullable[models.ExtendedOAuthServerMetadata] Optional OAuth2 authorization server metadata (authorization_endpoint, token_endpoint, etc.). When provided, skips .well-known discovery and uses these endpoints directly.
oauth2_server_metadata_url OptionalNullable[str] Optional URL to fetch OAuth2 authorization server metadata from (RFC 8414). When provided, the metadata is fetched from this URL and used instead of .well-known discovery. Mutually exclusive with oauth2_server_metadata.
system_prompt OptionalNullable[str] Optional system prompt for the connector.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.Connector

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

list

List all your custom connectors with keyset pagination and filters.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.list(page_size=100)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
query_filters Optional[models.ConnectorsQueryFilters] N/A
cursor OptionalNullable[str] N/A
page_size Optional[int] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.PaginatedConnectors

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

get_auth_url

Get the OAuth2 authorization URL for a connector to initiate user authentication.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.get_auth_url(connector_id_or_name="<value>", github_installation_link=False)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
app_return_url OptionalNullable[str] N/A
method_type Optional[models.OutboundAuthenticationType] Auth method type to use for the authorization URL. Required when the connector supports multiple interactive auth methods; otherwise the sole method is selected automatically. Use this to pick a specific method (e.g. 'oauth2' vs 'github_app').
credentials_name OptionalNullable[str] N/A
github_installation_link Optional[bool] Only valid with method_type=oauth2. When true, returns a GitHub App installation URL (https://github.com/apps//installations/new) if the connector has the proper configuration The Github application needs to have 'Request user authorization (OAuth) during installation' enabled to perform the proper auth loop.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.AuthURLResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

share

Transfers ownership of a private user-owned connector to the current workspace, making it available to all workspace members. This action is irreversible: once shared, the connector belongs to the workspace and can no longer be used privately across other workspaces. Any authentication flows that rely on the original owner's identity (e.g. OAuth on-behalf-of) will be affected and must be reconfigured after sharing. Only the connector's creator can call this endpoint. Requires the ShareConnectorToWorkspace workspace permission.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.share(connector_id="cf748b50-632b-46d6-98c3-b015086cb194")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

activate_for_organization

Enable a connector at the organization level so all members can use it.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.activate_for_organization(connector_id="a91bb4ec-caab-4cf2-be03-84b8343f4643")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
requires_confirmation OptionalNullable[models.RequiresConfirmation] N/A
skip_confirmation OptionalNullable[models.SkipConfirmation] N/A
include List[str] N/A
exclude List[str] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

deactivate_for_organization

Disable a connector at the organization level.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.deactivate_for_organization(connector_id="8f4c1089-2a37-44b3-a3c4-830ca7a0e439")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

activate_for_workspace

Enable a connector at the workspace level so all members of the workspace can use it.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.activate_for_workspace(connector_id="2adfa8af-3618-41a9-8980-e5ea1486e58e")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
requires_confirmation OptionalNullable[models.RequiresConfirmation] N/A
skip_confirmation OptionalNullable[models.SkipConfirmation] N/A
include List[str] N/A
exclude List[str] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

deactivate_for_workspace

Disable a connector at the workspace level.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.deactivate_for_workspace(connector_id="15b00e98-a9e7-4582-b0fc-87d28c3dac04")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

activate_for_user

Enable a connector for the calling user only.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.activate_for_user(connector_id="cd4fb4d2-de68-451f-8f2a-57fe39b33d96")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
requires_confirmation OptionalNullable[models.RequiresConfirmation] N/A
skip_confirmation OptionalNullable[models.SkipConfirmation] N/A
include List[str] N/A
exclude List[str] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

deactivate_for_user

Disable a connector for the calling user only.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.deactivate_for_user(connector_id="99c6ed86-e6bb-40ed-b6ee-d22ba791a68f")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

call_tool

Call a tool on an MCP connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.call_tool(tool_name="<value>", connector_id_or_name="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
tool_name str ✔️ N/A
connector_id_or_name str ✔️ N/A
credentials_name OptionalNullable[str] N/A
arguments Dict[str, Any] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ConnectorToolCallResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

list_tools

List all tools available for an MCP connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.list_tools(connector_id_or_name="<value>", page=1, page_size=100, refresh=False, pretty=False)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
page Optional[int] N/A
page_size Optional[int] N/A
refresh Optional[bool] N/A
pretty Optional[bool] Return a simplified payload with only name, description, annotations, and a compact inputSchema.
credentials_name OptionalNullable[str] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ResponseConnectorListToolsV1

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

get_authentication_methods

Get the authentication schema for a connector. Returns the list of supported authentication methods and their required headers.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.get_authentication_methods(connector_id_or_name="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

List[models.PublicAuthenticationMethod]

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

list_organization_credentials

List all credentials configured at the organization level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.list_organization_credentials(connector_id_or_name="<value>", fetch_default=False)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
auth_type OptionalNullable[models.OutboundAuthenticationType] N/A
fetch_default Optional[bool] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CredentialsResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

create_or_update_organization_credentials

Create or update credentials at the organization level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.create_or_update_organization_credentials(connector_id_or_name="<value>", name="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
name str ✔️ Name of the credentials. Use this name to access or modify your credentials.
is_default OptionalNullable[bool] Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged.
credentials OptionalNullable[models.ConnectionCredentials] The credential data (headers, bearer_token).
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

list_workspace_credentials

List all credentials configured at the workspace level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.list_workspace_credentials(connector_id_or_name="<value>", fetch_default=False)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
auth_type OptionalNullable[models.OutboundAuthenticationType] N/A
fetch_default Optional[bool] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CredentialsResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

create_or_update_workspace_credentials

Create or update credentials at the workspace level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.create_or_update_workspace_credentials(connector_id_or_name="<value>", name="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
name str ✔️ Name of the credentials. Use this name to access or modify your credentials.
is_default OptionalNullable[bool] Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged.
credentials OptionalNullable[models.ConnectionCredentials] The credential data (headers, bearer_token).
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

list_user_credentials

List all credentials configured at the user level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.list_user_credentials(connector_id_or_name="<value>", fetch_default=False)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
auth_type OptionalNullable[models.OutboundAuthenticationType] N/A
fetch_default Optional[bool] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CredentialsResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

create_or_update_user_credentials

Create or update credentials at the user level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.create_or_update_user_credentials(connector_id_or_name="<value>", name="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
name str ✔️ Name of the credentials. Use this name to access or modify your credentials.
is_default OptionalNullable[bool] Controls whether this credential is the default for its auth method. On creation: if no credential exists yet for this auth method, the credential is automatically set as default when is_default is true or omitted; setting is_default to false is rejected because a default must exist. If other credentials already exist, setting is_default to true promotes this credential (demoting the previous default); false or omitted creates it as non-default. On update: true promotes this credential, false is rejected if it is currently the default (promote another credential first), omitted leaves the default status unchanged.
credentials OptionalNullable[models.ConnectionCredentials] The credential data (headers, bearer_token).
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

delete_organization_credentials

Delete credentials at the organization level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.delete_organization_credentials(credentials_name="<value>", connector_id_or_name="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
credentials_name str ✔️ N/A
connector_id_or_name str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

delete_workspace_credentials

Delete credentials at the workspace level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.delete_workspace_credentials(credentials_name="<value>", connector_id_or_name="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
credentials_name str ✔️ N/A
connector_id_or_name str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

delete_user_credentials

Delete credentials at the user level for a given connector.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.delete_user_credentials(credentials_name="<value>", connector_id_or_name="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
credentials_name str ✔️ N/A
connector_id_or_name str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

get

Get a connector by its ID or name.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.get(connector_id_or_name="<value>", fetch_user_data=False, fetch_customer_data=False)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id_or_name str ✔️ N/A
fetch_user_data Optional[bool] Fetch the user-level data associated with the connector (e.g. connection credentials).
fetch_customer_data Optional[bool] Fetch the customer data associated with the connector (e.g. customer secrets / config).
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.Connector

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

update

Update a connector by its ID.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.update(connector_id="81d30634-113f-4dce-a89e-7786be2d8693")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
title OptionalNullable[str] Optional human-readable title for the connector.
name OptionalNullable[str] The name of the connector.
description OptionalNullable[str] The description of the connector.
icon_url OptionalNullable[str] The optional url of the icon you want to associate to the connector.
system_prompt OptionalNullable[str] Optional system prompt for the connector.
connection_config Dict[str, Any] Optional new connection config.
connection_secrets Dict[str, Any] Optional new connection secrets
server OptionalNullable[str] New server url for your mcp connector.
headers Dict[str, Any] New headers for your mcp connector.
auth_data OptionalNullable[models.AuthData] New authentication data for your mcp connector.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.Connector

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*

delete

Delete a connector by its ID.

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.connectors.delete(connector_id="5c3269fe-6a18-4216-b1fb-b093005874cd")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connector_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.MessageResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*