/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { metadataFieldsCreateMetadataField } from "../../funcs/metadataFieldsCreateMetadataField.js";
import { CreateMetadataFieldRequest$zodSchema } from "../../models/createmetadatafieldop.js";
import { formatResult } from "../tools.js";
const args = {
    request: CreateMetadataFieldRequest$zodSchema.describe(`The metadata field definition.`),
};
export const tool$metadataFieldsCreateMetadataField = {
    name: "create-metadata-field",
    description: `Creates a new structured metadata field in your account

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