/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { metadataRulesUpdateMetadataRule } from "../../funcs/metadataRulesUpdateMetadataRule.js";
import { MetadataRuleUpdate$zodSchema } from "../../models/metadataruleupdate.js";
import { formatResult } from "../tools.js";
const args = {
    external_id: z.string().describe("The unique identifier of the metadata rule."),
    metadata_rule_update: MetadataRuleUpdate$zodSchema.describe(`The updated metadata rule definition.`),
};
export const tool$metadataRulesUpdateMetadataRule = {
    name: "update-metadata-rule",
    description: `Updates an existing conditional metadata rule's definition

Updates the properties and configuration of an existing metadata rule.`,
    scopes: ["builder"],
    annotations: {
        "title": "Update Metadata Rule",
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "readOnlyHint": false,
    },
    args,
    tool: async (client, args, ctx) => {
        const [result] = await metadataRulesUpdateMetadataRule(client, args.external_id, args.metadata_rule_update, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        return formatResult(result.value);
    },
};
//# sourceMappingURL=metadataRulesUpdateMetadataRule.js.map