/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { metadataFieldsUpdateMetadataField } from "../../funcs/metadataFieldsUpdateMetadataField.js";
import { MetadataField$zodSchema } from "../../models/metadatafield.js";
import { formatResult } from "../tools.js";
const args = {
    external_id: z.string().describe("The external ID of the metadata field."),
    metadata_field: MetadataField$zodSchema.describe(`The updated metadata field definition.`),
};
export const tool$metadataFieldsUpdateMetadataField = {
    name: "update-metadata-field",
    description: `Updates the configuration of an existing metadata field

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