Class: Telnyx::Resources::AI::Missions::McpServers

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/ai/missions/mcp_servers.rb,
sig/telnyx/resources/ai/missions/mcp_servers.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ McpServers

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of McpServers.

Parameters:



136
137
138
# File 'lib/telnyx/resources/ai/missions/mcp_servers.rb', line 136

def initialize(client:)
  @client = client
end

Instance Method Details

#create_mcp_server(mission_id, request_options: {}) ⇒ Object

Adds an MCP server to the specified mission, making the server's tools available to agents during runs of this mission.

Parameters:

  • mission_id (String)

    Unique identifier of the mission.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (Object)

See Also:



20
21
22
23
24
25
26
27
# File 'lib/telnyx/resources/ai/missions/mcp_servers.rb', line 20

def create_mcp_server(mission_id, params = {})
  @client.request(
    method: :post,
    path: ["ai/missions/%1$s/mcp-servers", mission_id],
    model: Telnyx::Internal::Type::Unknown,
    options: params[:request_options]
  )
end

#delete_mcp_server(mcp_server_id, mission_id:, request_options: {}) ⇒ nil

Removes the specified MCP server from the mission, revoking agent access to its tools in subsequent runs.

Parameters:

  • mcp_server_id (String)

    Unique identifier of the mcp server.

  • mission_id (String)

    Unique identifier of the mission.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/telnyx/resources/ai/missions/mcp_servers.rb', line 43

def delete_mcp_server(mcp_server_id, params)
  parsed, options = Telnyx::AI::Missions::McpServerDeleteMcpServerParams.dump_request(params)
  mission_id =
    parsed.delete(:mission_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["ai/missions/%1$s/mcp-servers/%2$s", mission_id, mcp_server_id],
    model: NilClass,
    options: options
  )
end

#get_mcp_server(mcp_server_id, mission_id:, request_options: {}) ⇒ Object

Returns the configuration of a single MCP server attached to the specified mission.

Parameters:

  • mcp_server_id (String)

    Unique identifier of the mcp server.

  • mission_id (String)

    Unique identifier of the mission.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (Object)

See Also:



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/telnyx/resources/ai/missions/mcp_servers.rb', line 71

def get_mcp_server(mcp_server_id, params)
  parsed, options = Telnyx::AI::Missions::McpServerGetMcpServerParams.dump_request(params)
  mission_id =
    parsed.delete(:mission_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["ai/missions/%1$s/mcp-servers/%2$s", mission_id, mcp_server_id],
    model: Telnyx::Internal::Type::Unknown,
    options: options
  )
end

#list_mcp_servers(mission_id, request_options: {}) ⇒ Object

Returns the MCP servers configured on the specified mission. MCP servers expose external tools and data sources agents can use during runs.

Parameters:

  • mission_id (String)

    Unique identifier of the mission.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (Object)

See Also:



97
98
99
100
101
102
103
104
# File 'lib/telnyx/resources/ai/missions/mcp_servers.rb', line 97

def list_mcp_servers(mission_id, params = {})
  @client.request(
    method: :get,
    path: ["ai/missions/%1$s/mcp-servers", mission_id],
    model: Telnyx::Internal::Type::Unknown,
    options: params[:request_options]
  )
end

#update_mcp_server(mcp_server_id, mission_id:, request_options: {}) ⇒ Object

Replaces the configuration of the specified MCP server on this mission.

Parameters:

  • mcp_server_id (String)

    Unique identifier of the mcp server.

  • mission_id (String)

    Unique identifier of the mission.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (Object)

See Also:



119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/telnyx/resources/ai/missions/mcp_servers.rb', line 119

def update_mcp_server(mcp_server_id, params)
  parsed, options = Telnyx::AI::Missions::McpServerUpdateMcpServerParams.dump_request(params)
  mission_id =
    parsed.delete(:mission_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :put,
    path: ["ai/missions/%1$s/mcp-servers/%2$s", mission_id, mcp_server_id],
    model: Telnyx::Internal::Type::Unknown,
    options: options
  )
end