/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { metadataRulesCreateMetadataRule } from "../../funcs/metadataRulesCreateMetadataRule.js";
import { MetadataRuleCreate$zodSchema } from "../../models/metadatarulecreate.js";
import { formatResult } from "../tools.js";
const args = {
    request: MetadataRuleCreate$zodSchema.describe(`The metadata rule to create.`),
};
export const tool$metadataRulesCreateMetadataRule = {
    name: "create-metadata-rule",
    description: `Creates a new conditional metadata rule

Creates a new metadata rule with the specified properties and configuration.`,
    scopes: ["builder"],
    annotations: {
        "title": "Create Metadata Rule",
        "destructiveHint": false,
        "idempotentHint": false,
        "openWorldHint": false,
        "readOnlyHint": false,
    },
    args,
    tool: async (client, args, ctx) => {
        const [result] = await metadataRulesCreateMetadataRule(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=metadataRulesCreateMetadataRule.js.map