/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { powerPathLessonPlansAttachComponent } from "../../funcs/powerPathLessonPlansAttachComponent.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: operations.AttachComponentRequest$inboundSchema,
};
export const tool$powerPathLessonPlansAttachComponent = {
    name: "power-path-lesson-plans-attach-component",
    description: `Create a lesson plan item to attach a component to a lesson plan


    Creates a lessonPlanItem of type "component" and attaches it to lesson plan with the given ID.
    The lessonPlanItem *must* reference a course component for the course associated with the lesson plan.
    The parent lessonPlanItem, if any, must be of type "component" as well.

    `,
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await powerPathLessonPlansAttachComponent(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return formatResult(value, apiCall);
    },
};
//# sourceMappingURL=powerPathLessonPlansAttachComponent.js.map