Skip to content

Commit 2d31f53

Browse files
committed
feat(MCP): add update_bot tool
1 parent 87923a8 commit 2d31f53

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

silverback/cluster/mcp.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,35 @@ def bot_info(ctx: Context, bot_name: str) -> BotInfo:
139139
return bot
140140

141141

142+
@server.tool()
143+
def update_bot(
144+
ctx: Context,
145+
bot_name: str,
146+
new_name: str | None = None,
147+
new_image: str | None = None,
148+
new_ecosystem: str | None = None,
149+
new_network: str | None = None,
150+
new_provider: str | None = None,
151+
new_account: str | None = "<no-change>",
152+
new_environment: list[str] | None = None,
153+
) -> BotInfo:
154+
"""Remove a particular bot from the Cluster"""
155+
cluster: ClusterClient = ctx.request_context.lifespan_context
156+
157+
if not (bot := cluster.bots.get(bot_name)):
158+
raise RuntimeError("Unknown bot")
159+
160+
return bot.update(
161+
name=new_name,
162+
image=new_image,
163+
ecosystem=new_ecosystem,
164+
network=new_network,
165+
provider=new_provider,
166+
account=new_account,
167+
environment=new_environment,
168+
)
169+
170+
142171
@server.tool()
143172
def remove_bot(ctx: Context, bot_name: str):
144173
"""Remove a particular bot from the Cluster"""

0 commit comments

Comments
 (0)