add_agent
Configure and deploy a new AI agent within Enkrypt AI MCP Server. Specify agent details, endpoint URL, custom headers, response format, and tools to integrate the agent for real-time AI safety analysis and prompt auditing.
Instructions
Add a new agent using the provided configuration.
Args: config: A dictionary containing the agent configuration details. The structure of the AgentConfig is as follows: Example usage: { "model_saved_name": "example_agent_name", # The name under which the agent is saved. "model_version": "v1", # The version of the agent. "testing_for": "agents", # The purpose for which the agent is being tested. (Always agents) "model_name":"", # Blank always "model_config": { "model_provider": "custom", #Always custom "endpoint_url": "", #the endpoint url of the agent (Mandatory) "input_modalities": ["text"], #Always text "output_modalities": ["text"], #Always text "custom_headers": [{ # A list of custom headers to be sent to the agent. (Mandatory) "key": "Content-Type", "value": "application/json" }...], "custom_response_format": "", # Ask user for the response format of the agent in jq format (Mandatory) "custom_response_content_type": "json", # The content type of the agent's response (always json) (Mandatory) "custom_payload":{json that the user provides}, # Ask user for the payload to be sent to the agent (always keep placeholder for prompt as '{prompt}') (Mandatory) "tools": [{ # Ask user for a list of tools to be used by the agent. (MANDATORY) "name": "name of the tool", "description": "description of the tool" }...] }, } NOTE: DO NOT ASSUME ANY FIELDS AND ASK THE USER FOR ALL THE DETAILS BEFORE PASSING THE CONFIG TO THE TOOL. Ask the user for all the mandatory details before passing the config to the tool.
Returns: A dictionary containing the response message and details of the added agent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | Yes |
Input Schema (JSON Schema)
Implementation Reference
- src/mcp_server.py:251-292 (handler)The handler function for the 'add_agent' tool. Decorated with @mcp.tool() for registration in MCP. Takes agent configuration, calls model_client.add_model, and returns the response as a dictionary. Includes detailed docstring describing input schema.@mcp.tool() def add_agent(config: Dict[str, Any]) -> Dict[str, Any]: """ Add a new agent using the provided configuration. Args: config: A dictionary containing the agent configuration details. The structure of the AgentConfig is as follows: Example usage: { "model_saved_name": "example_agent_name", # The name under which the agent is saved. "model_version": "v1", # The version of the agent. "testing_for": "agents", # The purpose for which the agent is being tested. (Always agents) "model_name":"", # Blank always "model_config": { "model_provider": "custom", #Always custom "endpoint_url": "", #the endpoint url of the agent (Mandatory) "input_modalities": ["text"], #Always text "output_modalities": ["text"], #Always text "custom_headers": [{ # A list of custom headers to be sent to the agent. (Mandatory) "key": "Content-Type", "value": "application/json" }...], "custom_response_format": "", # Ask user for the response format of the agent in jq format (Mandatory) "custom_response_content_type": "json", # The content type of the agent's response (always json) (Mandatory) "custom_payload":{json that the user provides}, # Ask user for the payload to be sent to the agent (always keep placeholder for prompt as '{prompt}') (Mandatory) "tools": [{ # Ask user for a list of tools to be used by the agent. (MANDATORY) "name": "name of the tool", "description": "description of the tool" }...] }, } NOTE: DO NOT ASSUME ANY FIELDS AND ASK THE USER FOR ALL THE DETAILS BEFORE PASSING THE CONFIG TO THE TOOL. Ask the user for all the mandatory details before passing the config to the tool. Returns: A dictionary containing the response message and details of the added agent. """ # Add the agent using the provided configuration add_agent_response = model_client.add_model(config=copy.deepcopy(config)) # Return the response as a dictionary return add_agent_response.to_dict()
- src/mcp_server.py:253-287 (schema)The docstring of the add_agent function provides the detailed input schema, example configuration structure, mandatory fields, and notes on usage.""" Add a new agent using the provided configuration. Args: config: A dictionary containing the agent configuration details. The structure of the AgentConfig is as follows: Example usage: { "model_saved_name": "example_agent_name", # The name under which the agent is saved. "model_version": "v1", # The version of the agent. "testing_for": "agents", # The purpose for which the agent is being tested. (Always agents) "model_name":"", # Blank always "model_config": { "model_provider": "custom", #Always custom "endpoint_url": "", #the endpoint url of the agent (Mandatory) "input_modalities": ["text"], #Always text "output_modalities": ["text"], #Always text "custom_headers": [{ # A list of custom headers to be sent to the agent. (Mandatory) "key": "Content-Type", "value": "application/json" }...], "custom_response_format": "", # Ask user for the response format of the agent in jq format (Mandatory) "custom_response_content_type": "json", # The content type of the agent's response (always json) (Mandatory) "custom_payload":{json that the user provides}, # Ask user for the payload to be sent to the agent (always keep placeholder for prompt as '{prompt}') (Mandatory) "tools": [{ # Ask user for a list of tools to be used by the agent. (MANDATORY) "name": "name of the tool", "description": "description of the tool" }...] }, } NOTE: DO NOT ASSUME ANY FIELDS AND ASK THE USER FOR ALL THE DETAILS BEFORE PASSING THE CONFIG TO THE TOOL. Ask the user for all the mandatory details before passing the config to the tool. Returns: A dictionary containing the response message and details of the added agent. """
- src/mcp_server.py:251-251 (registration)The @mcp.tool() decorator registers the add_agent function as an MCP tool.@mcp.tool()