/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { metadataFieldsUpdateMetadataFieldDatasource } from "../../funcs/metadataFieldsUpdateMetadataFieldDatasource.js";
import { UpdateDatasourceRequest$zodSchema } from "../../models/updatedatasourcerequest.js";
import { formatResult } from "../tools.js";
const args = {
    external_id: z.string().describe("The external ID of the metadata field to update the datasource for."),
    update_datasource_request: UpdateDatasourceRequest$zodSchema.describe(`The updated datasource values.`),
};
export const tool$metadataFieldsUpdateMetadataFieldDatasource = {
    name: "update-metadata-datasource-values",
    description: `Updates the allowed values (the datasource) for a specified metadata field

Updates the values in a metadata field's datasource, including adding, modifying, or changing the order of values.`,
    scopes: ["builder"],
    annotations: {
        "title": "Update Metadata Datasource Values",
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "readOnlyHint": false,
    },
    args,
    tool: async (client, args, ctx) => {
        const [result] = await metadataFieldsUpdateMetadataFieldDatasource(client, args.external_id, args.update_datasource_request, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        return formatResult(result.value);
    },
};
//# sourceMappingURL=metadataFieldsUpdateMetadataFieldDatasource.js.map