/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { metadataRulesListMetadataRules } from "../../funcs/metadataRulesListMetadataRules.js";
import { ListMetadataRulesRequest$zodSchema } from "../../models/listmetadatarulesop.js";
import { formatResult } from "../tools.js";
const args = {
    request: ListMetadataRulesRequest$zodSchema.optional(),
};
export const tool$metadataRulesListMetadataRules = {
    name: "list-metadata-rules",
    description: `Retrieves a list of all conditional metadata rules defined in your account

Retrieves a list of all metadata rules in the cloud.`,
    scopes: ["builder"],
    annotations: {
        "title": "List Metadata Rules",
        "destructiveHint": false,
        "idempotentHint": true,
        "openWorldHint": false,
        "readOnlyHint": true,
    },
    args,
    tool: async (client, args, ctx) => {
        const [result] = await metadataRulesListMetadataRules(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=metadataRulesListMetadataRules.js.map