From 85fc8d7d2800c69ab4dfec68351165838a752c78 Mon Sep 17 00:00:00 2001 From: bot-hermes Date: Tue, 8 Sep 2026 11:22:00 +0000 Subject: [PATCH] fix: add UPDATE_PARAM_KEY for variable (UpdateVariableValue wants {name}), close #16 --- src/tools/update.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/tools/update.ts b/src/tools/update.ts index 7c68a5e..9423620 100644 --- a/src/tools/update.ts +++ b/src/tools/update.ts @@ -2,9 +2,16 @@ import { z } from "zod"; import { KomodoClient } from "../komodo-client.js"; import { ResourceType, UPDATE_REQUEST_MAP } from "../types.js"; +// Some UPDATE endpoints expect a different param key instead of { id }. +// Verified live against Core v2.3.3 error messages. +const UPDATE_PARAM_KEY: Record = { + tag: "tag", + variable: "name", +}; + export const updateInputSchema = { resource_type: ResourceType.describe( - "Resource type to update (stack, build, server, procedure, deployment, alerter, image_registry_account, sync_resource, user, tag)", + "Resource type to update (stack, build, server, procedure, deployment, alerter, image_registry_account, sync_resource, tag, action, repo, builder, swarm, variable, git_provider_account)", ), id: z.string().describe("Resource ID or name to update"), params: z @@ -32,9 +39,8 @@ export async function handleUpdate( ); } - // Tag update uses {tag} instead of {id} (same INSPECT_PARAM_KEY pattern) - const body = - resource_type === "tag" ? { tag: id, ...params } : { id, ...params }; + const paramKey = UPDATE_PARAM_KEY[resource_type] || "id"; + const body = { [paramKey]: id, ...params }; const result = await client.rpc("write", requestName, body); return {