@transcend-io/mcp-server-assessment 0.3.16 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-DMh8AG9n.mjs","names":[],"sources":["../src/tools/assessments_add_section.ts","../src/tools/assessments_answer_question.ts","../src/helpers/buildAssessmentLinks.ts","../src/tools/_helpers.ts","../src/tools/assessments_create.ts","../src/tools/assessments_create_group.ts","../src/tools/assessments_create_template.ts","../src/tools/assessments_export_template.ts","../src/tools/assessments_get.ts","../src/tools/assessments_list.ts","../src/tools/assessments_list_groups.ts","../src/tools/assessments_list_templates.ts","../src/tools/assessments_prefill.ts","../src/tools/assessments_submit_response.ts","../src/tools/assessments_update.ts","../src/tools/assessments_update_assignees.ts","../src/tools/index.ts","../src/graphql.ts"],"sourcesContent":["import {\n createToolResult,\n defineTool,\n z,\n type ToolClients,\n type AssessmentSectionInput,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const AddSectionSchema = z.object({\n template_id: z.string().describe('ID of the assessment form template to add the section to'),\n title: z.string().describe('Title of the new section'),\n questions: z\n .array(z.record(z.string(), z.unknown()))\n .optional()\n .describe(\n 'Array of question objects: [{title, type, subType?, description?, placeholder?, isRequired?, referenceId?, answerOptions?: [{value}], allowSelectOther?, requireRiskEvaluation?}]',\n ),\n});\nexport type AddSectionInput = z.infer<typeof AddSectionSchema>;\n\nexport function createAssessmentsAddSectionTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_add_section',\n description:\n 'Add a new section (with optional inline questions) to an existing assessment form template. ' +\n 'Useful for building templates incrementally or adding sections to imported templates. ' +\n 'Same auto-corrections as assessments_create_template apply to questions.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Adds a section to the assessment template',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: AddSectionSchema,\n handler: async ({ template_id, title, questions }) => {\n const result = await graphql.createAssessmentSection({\n assessmentFormTemplateId: template_id,\n title,\n questions: questions as AssessmentSectionInput['questions'],\n });\n\n return createToolResult(true, {\n section: result,\n message: `Section \"${title}\" added to template successfully`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const AnswerQuestionValueSchema = z.object({\n value: z.string(),\n isUserCreated: z.boolean(),\n});\nexport type AnswerQuestionValueInput = z.infer<typeof AnswerQuestionValueSchema>;\n\nexport const AnswerQuestionSchema = z.object({\n assessment_question_id: z.string().describe('ID of the assessment question to answer'),\n assessment_answer_ids: z\n .array(z.string())\n .optional()\n .describe(\n 'IDs of existing answer options to select (for SINGLE_SELECT/MULTI_SELECT questions)',\n ),\n assessment_answer_values: z\n .array(AnswerQuestionValueSchema)\n .optional()\n .describe(\n 'Free-text answer values to create and select (for text questions). Each item: {value: string, isUserCreated: boolean}',\n ),\n});\nexport type AnswerQuestionInput = z.infer<typeof AnswerQuestionSchema>;\n\nexport function createAssessmentsAnswerQuestionTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_answer_question',\n description:\n 'Answer an assessment question by selecting existing answer options or providing free-text values. For SINGLE_SELECT/MULTI_SELECT questions, provide assessmentAnswerIds from the answerOptions. For SHORT_ANSWER_TEXT/LONG_ANSWER_TEXT, provide assessmentAnswerValues with {value, isUserCreated: true}.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Records answer to the assessment question',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: AnswerQuestionSchema,\n handler: async ({\n assessment_question_id,\n assessment_answer_ids,\n assessment_answer_values,\n }) => {\n const input: {\n assessmentQuestionId: string;\n assessmentAnswerIds?: string[];\n assessmentAnswerValues?: { value: string; isUserCreated: boolean }[];\n } = {\n assessmentQuestionId: assessment_question_id,\n };\n\n if (assessment_answer_ids) {\n input.assessmentAnswerIds = assessment_answer_ids;\n }\n if (assessment_answer_values) {\n input.assessmentAnswerValues = assessment_answer_values;\n }\n\n const result = await graphql.selectAssessmentQuestionAnswers(input);\n\n return createToolResult(true, {\n selectedAnswers: result,\n message: 'Assessment question answered successfully',\n });\n },\n });\n}\n","/** Inputs to {@link buildAssessmentLinks}. */\nexport interface BuildAssessmentLinksInput {\n /** Base admin-dashboard URL (e.g. `https://app.transcend.io`) */\n dashboardUrl: string;\n /** The assessment form ID */\n assessmentFormId: string;\n}\n\n/** Deep link into the Transcend admin dashboard for a given assessment. */\nexport interface AssessmentLinks {\n /** Read-only response page for the assessment. */\n url: string;\n}\n\n/**\n * Build the canonical admin-dashboard deep link for an assessment.\n *\n * Always points at `/assessments/forms/:id/response`, mirroring the\n * dashboard's own \"View Responses\" row action. The fillable\n * `/assessments/forms/:id/view` route is intentionally not emitted —\n * it only resolves for the form's assignee, which the MCP can't verify.\n */\nexport function buildAssessmentLinks({\n dashboardUrl,\n assessmentFormId,\n}: BuildAssessmentLinksInput): AssessmentLinks {\n const base = dashboardUrl.replace(/\\/$/, '');\n return { url: `${base}/assessments/forms/${assessmentFormId}/response` };\n}\n\n/** Build a link to the assessment-group page (for group-level tools). */\nexport function buildAssessmentGroupUrl(dashboardUrl: string, assessmentGroupId: string): string {\n return `${dashboardUrl.replace(/\\/$/, '')}/assessments/groups/${assessmentGroupId}`;\n}\n","import { createToolResult } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\n/**\n * Resolves a template_id to an assessment group ID by searching through all groups.\n * Returns either the group ID or an error result.\n */\nexport async function resolveTemplateToGroupId(\n graphql: AssessmentsMixin,\n templateId: string,\n): Promise<{ groupId: string } | { error: ReturnType<typeof createToolResult> }> {\n const groups = await graphql.listAssessmentGroups({ first: 100 });\n const matchingGroups = groups.nodes.filter((g) => g.assessmentFormTemplate?.id === templateId);\n\n if (matchingGroups.length === 0) {\n return {\n error: createToolResult(\n false,\n undefined,\n `No assessment group found for template_id \"${templateId}\". Use assessments_list_groups to see available groups.`,\n ),\n };\n }\n\n if (matchingGroups.length > 1) {\n const ids = matchingGroups.map((g) => g.id).join(', ');\n return {\n error: createToolResult(\n false,\n undefined,\n `Multiple assessment groups found for template_id \"${templateId}\" (group IDs: ${ids}). ` +\n `Please specify assessment_group_id explicitly. Use assessments_list_groups to find available groups.`,\n ),\n };\n }\n\n return { groupId: matchingGroups[0]!.id };\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\nimport { resolveTemplateToGroupId } from './_helpers.js';\n\nexport const CreateAssessmentSchema = z.object({\n title: z.string().describe('Title of the assessment'),\n assessment_group_id: z\n .string()\n .optional()\n .describe(\n 'ID of the assessment group to create the assessment in (preferred). Use assessments_list_groups to find available groups.',\n ),\n template_id: z\n .string()\n .optional()\n .describe(\n 'ID of the assessment template. If assessment_group_id is not provided, the first group using this template will be used.',\n ),\n assignee_ids: z\n .array(z.string())\n .optional()\n .describe('Array of user IDs to assign the assessment to'),\n});\nexport type CreateAssessmentInput = z.infer<typeof CreateAssessmentSchema>;\n\nexport function createAssessmentsCreateTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_create',\n description:\n 'Create a new privacy assessment within an assessment group. Assessment groups are linked to templates. You can provide either an assessment_group_id directly, or a template_id to auto-resolve the first matching group. Use assessments_list_groups to find available groups. The response includes a `url` field with the canonical admin-dashboard link — surface that to the user verbatim and do not construct assessment URLs from raw IDs.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Creates a new privacy assessment',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: CreateAssessmentSchema,\n handler: async ({ title, assessment_group_id, template_id, assignee_ids }) => {\n let assessmentGroupId = assessment_group_id;\n\n if (!assessmentGroupId && template_id) {\n const resolved = await resolveTemplateToGroupId(graphql, template_id);\n if ('error' in resolved) return resolved.error;\n assessmentGroupId = resolved.groupId;\n }\n\n if (!assessmentGroupId) {\n return createToolResult(\n false,\n undefined,\n 'Either assessment_group_id or template_id must be provided. Use assessments_list_groups to find available groups.',\n );\n }\n\n const result = await graphql.createAssessment({\n title,\n assessmentGroupId,\n assigneeIds: assignee_ids,\n });\n\n const links = buildAssessmentLinks({ dashboardUrl, assessmentFormId: result.id });\n\n return createToolResult(true, {\n assessment: { ...result, ...links },\n ...links,\n message: `Assessment \"${title}\" created successfully. Open it at ${links.url}`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentGroupUrl } from '../helpers/buildAssessmentLinks.js';\n\nexport const CreateGroupSchema = z.object({\n title: z.string().describe('Title of the assessment group'),\n template_id: z.string().describe('ID of the assessment template to link this group to'),\n description: z.string().optional().describe('Description of the assessment group (optional)'),\n reviewer_ids: z\n .array(z.string())\n .optional()\n .describe('IDs of users assigned to review new assessments in this group (optional)'),\n});\nexport type CreateGroupInput = z.infer<typeof CreateGroupSchema>;\n\nexport function createAssessmentsCreateGroupTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_create_group',\n description:\n 'Create a new assessment group linked to a template. Assessment groups are containers for assessments. The response includes a `groupUrl` field with the canonical admin-dashboard link to the group — surface that to the user verbatim.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Creates a new assessment group',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: CreateGroupSchema,\n handler: async ({ title, template_id, description, reviewer_ids }) => {\n const result = await graphql.createAssessmentGroup({\n title,\n assessmentFormTemplateId: template_id,\n description,\n reviewerIds: reviewer_ids,\n });\n\n const groupUrl = buildAssessmentGroupUrl(dashboardUrl, result.id);\n\n return createToolResult(true, {\n assessmentGroup: { ...result, groupUrl },\n groupUrl,\n message: `Assessment group \"${title}\" created successfully. View it at ${groupUrl}`,\n });\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n z,\n type ToolClients,\n type AssessmentTemplateCreateInput,\n type AssessmentSectionInput,\n} from '@transcend-io/mcp-server-base';\nimport { AssessmentFormTemplateStatus } from '@transcend-io/privacy-types';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const CreateTemplateSchema = z.object({\n title: z.string().describe('Title of the assessment form template'),\n description: z.string().optional().describe('Description of the template'),\n status: z\n .nativeEnum(AssessmentFormTemplateStatus)\n .optional()\n .describe('Template status: DRAFT or PUBLISHED (default: DRAFT)'),\n sections: z\n .array(z.record(z.string(), z.unknown()))\n .optional()\n .describe('Array of section objects with title and optional questions array'),\n});\nexport type CreateTemplateInput = z.infer<typeof CreateTemplateSchema>;\n\nexport function createAssessmentsCreateTemplateTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_create_template',\n description:\n 'Create a new assessment form template with sections and questions inline. ' +\n 'This is the \"import\" side of the JSON import/export workflow. ' +\n 'You can provide the full template structure (sections with questions and answer options) in a single call. ' +\n 'Question types: LONG_ANSWER_TEXT, SHORT_ANSWER_TEXT, SINGLE_SELECT, MULTI_SELECT, FILE. ' +\n 'SubTypes: NONE, CUSTOM, USER, TEAM, DATA_SUB_CATEGORY, HAS_PERSONAL_DATA, ATTRIBUTE_KEY, SENSITIVE_CATEGORY. ' +\n 'Auto-corrections: referenceId is auto-generated as UUID if missing or not UUID format; ' +\n 'subType is auto-set to CUSTOM when allowSelectOther is true; ' +\n 'requireRiskEvaluation is ignored when no riskFrameworkId is provided.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Creates a new assessment form template',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: CreateTemplateSchema,\n handler: async ({ title, description, status, sections }) => {\n const input: AssessmentTemplateCreateInput = {\n title,\n description,\n status: status ?? 'DRAFT',\n sections: sections as AssessmentSectionInput[] | undefined,\n };\n\n const result = await graphql.createAssessmentFormTemplate(input);\n\n return createToolResult(true, {\n template: result,\n message: `Assessment template \"${title}\" created successfully`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const ExportTemplateSchema = z.object({\n template_id: z.string().describe('ID of the assessment form template to export'),\n});\nexport type ExportTemplateInput = z.infer<typeof ExportTemplateSchema>;\n\nexport function createAssessmentsExportTemplateTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_export_template',\n description:\n 'Export a full assessment form template as JSON, including all sections, questions, answer options, ' +\n 'and configuration. This is the \"export\" side of the JSON import/export workflow. ' +\n 'The output can be used as input for assessments_create_template to recreate the template elsewhere.',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ExportTemplateSchema,\n handler: async ({ template_id }) => {\n const template = await graphql.getAssessmentFormTemplate(template_id);\n\n const exportData = {\n _exportedAt: new Date().toISOString(),\n _format: 'transcend-assessment-template-v1',\n template: {\n title: template.title,\n description: template.description,\n status: template.status,\n sections: template.sections.map((section) => ({\n title: section.title,\n questions: section.questions.map((q) => ({\n title: q.title,\n type: q.type,\n subType: q.subType,\n description: q.description,\n placeholder: q.placeholder,\n isRequired: q.isRequired,\n referenceId: q.referenceId,\n allowSelectOther: q.allowSelectOther,\n requireRiskEvaluation: q.requireRiskEvaluation,\n answerOptions: q.answerOptions.map((opt) => ({\n value: opt.value,\n })),\n })),\n })),\n },\n _raw: template,\n };\n\n return createToolResult(true, exportData);\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\n\nexport const GetAssessmentSchema = z.object({\n assessment_id: z.string().describe('ID of the assessment to retrieve'),\n assessment_name: z\n .string()\n .optional()\n .describe(\n 'Optional human-readable name (e.g. title) for the tool call in chat; not sent to the API.',\n ),\n});\nexport type GetAssessmentInput = z.infer<typeof GetAssessmentSchema>;\n\nexport function createAssessmentsGetTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_get',\n description:\n 'Get detailed information about a specific assessment including questions and responses. The response includes a `url` field with the canonical admin-dashboard link — surface that to the user verbatim and do not construct assessment URLs from raw IDs.',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: GetAssessmentSchema,\n handler: async ({ assessment_id }) => {\n const result = await graphql.getAssessment(assessment_id);\n const links = buildAssessmentLinks({ dashboardUrl, assessmentFormId: result.id });\n return createToolResult(true, { ...result, ...links });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n z,\n PaginationSchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\nimport { AssessmentFormStatus } from '@transcend-io/privacy-types';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\n\nexport const AssessmentStatusEnum = z.nativeEnum(AssessmentFormStatus);\nexport type AssessmentStatusEnumInput = z.infer<typeof AssessmentStatusEnum>;\n\nexport const ListAssessmentsSchema = z\n .object({\n status: AssessmentStatusEnum.optional().describe('Filter by assessment status'),\n })\n .merge(PaginationSchema);\nexport type ListAssessmentsInput = z.infer<typeof ListAssessmentsSchema>;\n\nexport function createAssessmentsListTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_list',\n description:\n 'List all privacy assessments in your organization. Supports filtering by status. Each row includes a `url` field with the canonical admin-dashboard link for that assessment — surface those to the user verbatim and do not construct assessment URLs from raw IDs. Note: Cursor pagination is not supported (max 100 results).',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListAssessmentsSchema,\n handler: async ({ status, limit, cursor }) => {\n const result = await graphql.listAssessments({\n first: limit,\n after: cursor,\n filterBy: status ? { statuses: [status] } : undefined,\n });\n\n const nodesWithLinks = result.nodes.map((node) => ({\n ...node,\n ...buildAssessmentLinks({ dashboardUrl, assessmentFormId: node.id }),\n }));\n\n return createListResult(nodesWithLinks, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentGroupUrl } from '../helpers/buildAssessmentLinks.js';\n\nexport const ListGroupsSchema = PaginationSchema;\nexport type ListGroupsInput = z.infer<typeof ListGroupsSchema>;\n\nexport function createAssessmentsListGroupsTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_list_groups',\n description:\n 'List all assessment groups. Groups are containers for assessments and are linked to templates. Use this to find the right group ID for creating assessments. Each row includes a `groupUrl` field with the canonical admin-dashboard link — surface those to the user verbatim.',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListGroupsSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listAssessmentGroups({\n first: limit,\n after: cursor,\n });\n\n const nodesWithLinks = result.nodes.map((node) => ({\n ...node,\n groupUrl: buildAssessmentGroupUrl(dashboardUrl, node.id),\n }));\n\n return createListResult(nodesWithLinks, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const ListTemplatesSchema = PaginationSchema;\nexport type ListTemplatesInput = z.infer<typeof ListTemplatesSchema>;\n\nexport function createAssessmentsListTemplatesTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_list_templates',\n description:\n 'List all available assessment templates. Note: Cursor pagination is not supported by the Transcend API for templates - use limit to control results (max 100).',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListTemplatesSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listAssessmentTemplates({\n first: limit,\n after: cursor,\n });\n\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n z,\n type ToolClients,\n type Assessment,\n type AssessmentSection,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { resolveTemplateToGroupId } from './_helpers.js';\n\nexport const PrefillSchema = z.object({\n title: z.string().describe('Title for the new assessment form'),\n template_id: z\n .string()\n .optional()\n .describe(\n 'Template ID to create the form from. Will auto-resolve to the first matching assessment group.',\n ),\n assessment_group_id: z\n .string()\n .optional()\n .describe('Assessment group ID (alternative to template_id)'),\n answers: z\n .record(z.string(), z.union([z.string(), z.array(z.string())]))\n .describe(\n 'Map of answers keyed by question title or referenceId. Values should be strings for text/single-select, or arrays of strings for multi-select.',\n ),\n assignee_ids: z\n .array(z.string())\n .optional()\n .describe('Internal user IDs to assign the form to (optional)'),\n assignee_emails: z\n .array(z.string())\n .optional()\n .describe('External email addresses to assign the form to (optional)'),\n reviewer_ids: z.array(z.string()).optional().describe('User IDs to set as reviewers (optional)'),\n submit_for_review: z\n .boolean()\n .optional()\n .describe(\n 'Whether to automatically submit the form for review after prefilling (default: false)',\n ),\n});\nexport type PrefillInput = z.infer<typeof PrefillSchema>;\n\nexport function createAssessmentsPrefillTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_prefill',\n description:\n 'Convenience tool: Create a new assessment form, AI-prefill all the answers, and assign it to a reviewer. ' +\n 'Combines: create form → get questions → answer each question → assign reviewers → optionally submit for review. ' +\n 'Provide answers as a map of {questionTitle: answer} or {referenceId: answer}. ' +\n 'For SINGLE_SELECT/MULTI_SELECT, the answer should match the exact text of the answer option(s). ' +\n 'For text questions, provide the free-text answer string. ' +\n 'For multi-select, provide an array of answer option values.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Creates assessment, prefills answers, assigns reviewers',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: PrefillSchema,\n handler: async ({\n answers,\n title,\n assessment_group_id,\n template_id,\n assignee_ids,\n assignee_emails,\n reviewer_ids,\n submit_for_review,\n }) => {\n let assessmentGroupId = assessment_group_id;\n if (!assessmentGroupId && template_id) {\n const resolved = await resolveTemplateToGroupId(graphql, template_id);\n if ('error' in resolved) return resolved.error;\n assessmentGroupId = resolved.groupId;\n }\n if (!assessmentGroupId) {\n return createToolResult(\n false,\n undefined,\n 'Either template_id or assessment_group_id is required.',\n );\n }\n\n const assessment = await graphql.createAssessment({\n title,\n assessmentGroupId,\n });\n const assessmentId = assessment.id;\n\n const fullForm = await graphql.getAssessment(assessmentId);\n if (!fullForm.sections || fullForm.sections.length === 0) {\n return createToolResult(true, {\n assessment: fullForm,\n message: 'Assessment created but has no sections/questions to prefill.',\n answersApplied: 0,\n });\n }\n\n const results: { question: string; status: string; answer?: string }[] = [];\n let answersApplied = 0;\n let answersSkipped = 0;\n\n for (const section of fullForm.sections as AssessmentSection[]) {\n if (!section.questions) continue;\n\n for (const question of section.questions) {\n const answerKey = Object.keys(answers).find(\n (key) =>\n key === question.referenceId ||\n key.toLowerCase() === (question.title || '').toLowerCase() ||\n key === question.id,\n );\n\n if (!answerKey) {\n results.push({\n question: question.title || question.id,\n status: 'skipped',\n });\n answersSkipped++;\n continue;\n }\n\n const answerValue = answers[answerKey];\n if (answerValue === undefined) {\n results.push({\n question: question.title || question.id,\n status: 'skipped',\n });\n answersSkipped++;\n continue;\n }\n\n try {\n const qType = (question.type || '').toUpperCase();\n\n if (qType === 'SINGLE_SELECT' || qType === 'MULTI_SELECT') {\n const answerValues = Array.isArray(answerValue) ? answerValue : [answerValue];\n const matchedIds: string[] = [];\n\n for (const val of answerValues) {\n const matchedOption = (question.answerOptions || []).find(\n (opt) => opt.value.toLowerCase() === val.toLowerCase(),\n );\n if (matchedOption) {\n matchedIds.push(matchedOption.id);\n }\n }\n\n if (matchedIds.length > 0) {\n await graphql.selectAssessmentQuestionAnswers({\n assessmentQuestionId: question.id,\n assessmentAnswerIds: matchedIds,\n });\n answersApplied++;\n results.push({\n question: question.title || question.id,\n status: 'answered',\n answer: answerValues.join(', '),\n });\n } else {\n await graphql.selectAssessmentQuestionAnswers({\n assessmentQuestionId: question.id,\n assessmentAnswerValues: answerValues.map((v) => ({\n value: v,\n isUserCreated: true,\n })),\n });\n answersApplied++;\n results.push({\n question: question.title || question.id,\n status: 'answered (custom value)',\n answer: answerValues.join(', '),\n });\n }\n } else {\n const textValue = Array.isArray(answerValue) ? answerValue.join('\\n') : answerValue;\n await graphql.selectAssessmentQuestionAnswers({\n assessmentQuestionId: question.id,\n assessmentAnswerValues: [{ value: textValue, isUserCreated: true }],\n });\n answersApplied++;\n results.push({\n question: question.title || question.id,\n status: 'answered',\n answer: textValue.length > 100 ? textValue.substring(0, 100) + '...' : textValue,\n });\n }\n } catch (err) {\n results.push({\n question: question.title || question.id,\n status: `error: ${err instanceof Error ? err.message : String(err)}`,\n });\n }\n }\n }\n\n let assignmentResult: Record<string, unknown> | null = null;\n if (assignee_ids || assignee_emails) {\n assignmentResult = await graphql.updateAssessmentFormAssignees({\n id: assessmentId,\n assigneeIds: assignee_ids,\n externalAssigneeEmails: assignee_emails,\n });\n }\n\n if (reviewer_ids) {\n await graphql.updateAssessment({\n id: assessmentId,\n reviewerIds: reviewer_ids,\n });\n }\n\n let submitResult: Assessment | null = null;\n if (submit_for_review) {\n const sectionIds = (fullForm.sections as AssessmentSection[]).map((s) => s.id);\n if (sectionIds.length > 0) {\n submitResult = await graphql.submitAssessmentForReview({\n id: assessmentId,\n assessmentSectionIds: sectionIds,\n });\n }\n }\n\n return createToolResult(true, {\n assessmentId,\n title,\n answersApplied,\n answersSkipped,\n totalQuestions: results.length,\n results,\n assignment: assignmentResult\n ? {\n status: assignmentResult.status,\n message: 'Assignees updated',\n }\n : null,\n submittedForReview: !!submitResult,\n message:\n `Assessment \"${title}\" created and prefilled with ${answersApplied}/${results.length} answers. ` +\n (assignmentResult ? `Assigned to reviewers. ` : '') +\n (submitResult ? 'Submitted for review.' : 'Ready for manual submission.'),\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\n\nexport const SubmitResponseSchema = z.object({\n assessment_id: z.string().describe('ID of the assessment to submit for review'),\n assessment_section_ids: z\n .array(z.string())\n .describe('Array of section IDs to submit for review. Required by the API.'),\n});\nexport type SubmitResponseInput = z.infer<typeof SubmitResponseSchema>;\n\nexport function createAssessmentsSubmitResponseTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_submit_response',\n description:\n 'Submit an assessment form for review. Optionally specify which sections to submit. This transitions the assessment toward the IN_REVIEW status. The response includes a `url` field pointing at the assessment-group page where reviewers can find the submitted form — surface that to the user verbatim and do not construct assessment URLs from raw IDs.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Submits assessment for review — cannot be undone',\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },\n zodSchema: SubmitResponseSchema,\n handler: async ({ assessment_id, assessment_section_ids }) => {\n const result = await graphql.submitAssessmentForReview({\n id: assessment_id,\n assessmentSectionIds: assessment_section_ids,\n });\n\n const links = buildAssessmentLinks({ dashboardUrl, assessmentFormId: result.id });\n\n return createToolResult(true, {\n assessment: { ...result, ...links },\n ...links,\n message: `Assessment submitted for review successfully. View it at ${links.url}`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\nimport { AssessmentStatusEnum } from './assessments_list.js';\n\nexport const UpdateAssessmentSchema = z.object({\n assessment_id: z.string().describe('ID of the assessment to update'),\n title: z.string().optional().describe('New title for the assessment'),\n description: z.string().optional().describe('New description'),\n reviewer_ids: z\n .array(z.string())\n .optional()\n .describe('IDs of users assigned to review this assessment'),\n due_date: z.string().optional().describe('New due date (ISO format)'),\n status: AssessmentStatusEnum.optional().describe('New status'),\n});\nexport type UpdateAssessmentInput = z.infer<typeof UpdateAssessmentSchema>;\n\nexport function createAssessmentsUpdateTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_update',\n description:\n 'Update an existing assessment. The response includes a `url` field with the canonical admin-dashboard link — surface that to the user verbatim and do not construct assessment URLs from raw IDs.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Updates the assessment',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: UpdateAssessmentSchema,\n handler: async ({ assessment_id, title, description, reviewer_ids, due_date, status }) => {\n const result = await graphql.updateAssessment({\n id: assessment_id,\n title,\n description,\n reviewerIds: reviewer_ids,\n dueDate: due_date,\n status,\n });\n\n const links = buildAssessmentLinks({ dashboardUrl, assessmentFormId: result.id });\n\n return createToolResult(true, {\n assessment: { ...result, ...links },\n ...links,\n message: `Assessment updated successfully. View it at ${links.url}`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const UpdateAssigneesSchema = z.object({\n assessment_id: z.string().describe('ID of the assessment form to update assignees for'),\n assignee_ids: z\n .array(z.string())\n .optional()\n .describe('Array of internal user IDs to assign to the assessment'),\n external_assignee_emails: z\n .array(z.string())\n .optional()\n .describe('Array of external email addresses to assign to the assessment'),\n});\nexport type UpdateAssigneesInput = z.infer<typeof UpdateAssigneesSchema>;\n\nexport function createAssessmentsUpdateAssigneesTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_update_assignees',\n description:\n 'Assign internal users (by ID) or external users (by email) to an assessment form. This also transitions DRAFT assessments to SHARED status.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Assigns users to the assessment form',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: UpdateAssigneesSchema,\n handler: async ({ assessment_id, assignee_ids, external_assignee_emails }) => {\n const result = await graphql.updateAssessmentFormAssignees({\n id: assessment_id,\n assigneeIds: assignee_ids,\n externalAssigneeEmails: external_assignee_emails,\n });\n\n return createToolResult(true, {\n assessment: result,\n message: `Assessment assignees updated successfully. Status: ${result.status}`,\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createAssessmentsAddSectionTool } from './assessments_add_section.js';\nimport { createAssessmentsAnswerQuestionTool } from './assessments_answer_question.js';\nimport { createAssessmentsCreateTool } from './assessments_create.js';\nimport { createAssessmentsCreateGroupTool } from './assessments_create_group.js';\nimport { createAssessmentsCreateTemplateTool } from './assessments_create_template.js';\nimport { createAssessmentsExportTemplateTool } from './assessments_export_template.js';\nimport { createAssessmentsGetTool } from './assessments_get.js';\nimport { createAssessmentsListTool } from './assessments_list.js';\nimport { createAssessmentsListGroupsTool } from './assessments_list_groups.js';\nimport { createAssessmentsListTemplatesTool } from './assessments_list_templates.js';\nimport { createAssessmentsPrefillTool } from './assessments_prefill.js';\nimport { createAssessmentsSubmitResponseTool } from './assessments_submit_response.js';\nimport { createAssessmentsUpdateTool } from './assessments_update.js';\nimport { createAssessmentsUpdateAssigneesTool } from './assessments_update_assignees.js';\n\nexport function getAssessmentTools(clients: ToolClients): ToolDefinition[] {\n return [\n createAssessmentsListTool(clients),\n createAssessmentsGetTool(clients),\n createAssessmentsCreateTool(clients),\n createAssessmentsCreateGroupTool(clients),\n createAssessmentsListGroupsTool(clients),\n createAssessmentsUpdateTool(clients),\n createAssessmentsListTemplatesTool(clients),\n createAssessmentsUpdateAssigneesTool(clients),\n createAssessmentsAnswerQuestionTool(clients),\n createAssessmentsSubmitResponseTool(clients),\n createAssessmentsCreateTemplateTool(clients),\n createAssessmentsAddSectionTool(clients),\n createAssessmentsExportTemplateTool(clients),\n createAssessmentsPrefillTool(clients),\n ];\n}\n","import {\n TranscendGraphQLBase,\n type PaginatedResponse,\n type Assessment,\n type AssessmentTemplate,\n type AssessmentGroup,\n type AssessmentCreateInput,\n type AssessmentUpdateInput,\n type AssessmentSubmitForReviewInput,\n type AssessmentTemplateCreateInput,\n type AssessmentTemplateExport,\n type AssessmentQuestionInput,\n type ListOptions,\n} from '@transcend-io/mcp-server-base';\n\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\nfunction generateUUID(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n\nfunction normalizeQuestion(q: AssessmentQuestionInput): Record<string, unknown> {\n let { referenceId, subType, allowSelectOther, requireRiskEvaluation } = q;\n\n if (!referenceId || !UUID_RE.test(referenceId)) {\n referenceId = generateUUID();\n }\n\n if (allowSelectOther && (!subType || subType === 'NONE')) {\n subType = 'CUSTOM';\n }\n\n if (requireRiskEvaluation && !q.riskFrameworkId) {\n requireRiskEvaluation = false;\n }\n\n return {\n title: q.title,\n type: q.type,\n subType: subType || 'NONE',\n placeholder: q.placeholder || '',\n description: q.description || '',\n isRequired: q.isRequired ?? false,\n referenceId,\n answerOptions: q.answerOptions || [],\n allowSelectOther: allowSelectOther ?? false,\n requireRiskEvaluation: requireRiskEvaluation ?? false,\n ...(q.riskLogic && { riskLogic: q.riskLogic }),\n ...(q.riskCategoryIds && { riskCategoryIds: q.riskCategoryIds }),\n ...(q.riskFrameworkId && { riskFrameworkId: q.riskFrameworkId }),\n ...(q.displayLogic && { displayLogic: q.displayLogic }),\n };\n}\n\nexport class AssessmentsMixin extends TranscendGraphQLBase {\n async listAssessments(\n options?: ListOptions & { filterBy?: { statuses?: string[] } },\n ): Promise<PaginatedResponse<Assessment>> {\n const query = `\n query ListAssessments($first: Int, $filterBy: AssessmentFormFiltersInput) {\n assessmentForms(first: $first, filterBy: $filterBy) {\n nodes {\n id\n title\n status\n createdAt\n assessmentGroup {\n id\n }\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentForms: {\n nodes: Array<Omit<Assessment, 'assessmentGroupId'> & { assessmentGroup?: { id: string } }>;\n totalCount: number;\n };\n }>(query, {\n first: Math.min(options?.first || 50, 100),\n filterBy: options?.filterBy?.statuses ? { statuses: options.filterBy.statuses } : undefined,\n });\n return {\n nodes: data.assessmentForms.nodes.map(({ assessmentGroup, ...rest }) => ({\n ...rest,\n assessmentGroupId: assessmentGroup?.id,\n })),\n pageInfo: {\n hasNextPage: data.assessmentForms.nodes.length < data.assessmentForms.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.assessmentForms.totalCount,\n };\n }\n\n async getAssessment(id: string): Promise<Assessment> {\n const query = `\n query GetAssessment($ids: [ID!]!) {\n assessmentForms(first: 1, filterBy: { ids: $ids }) {\n nodes {\n id\n title\n status\n dueDate\n submittedAt\n createdAt\n updatedAt\n assessmentGroup {\n id\n }\n sections {\n id\n title\n index\n status\n questions {\n id\n title\n index\n type\n subType\n description\n isRequired\n placeholder\n answerOptions {\n id\n index\n value\n }\n selectedAnswers {\n id\n index\n value\n }\n }\n }\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentForms: {\n nodes: Array<Omit<Assessment, 'assessmentGroupId'> & { assessmentGroup?: { id: string } }>;\n };\n }>(query, { ids: [id] });\n const node = data.assessmentForms.nodes[0];\n if (!node) {\n throw new Error(`Assessment with id ${id} not found`);\n }\n const { assessmentGroup, ...rest } = node;\n return { ...rest, assessmentGroupId: assessmentGroup?.id };\n }\n\n async selectAssessmentQuestionAnswers(input: {\n assessmentQuestionId: string;\n assessmentAnswerIds?: string[];\n assessmentAnswerValues?: { value: string; isUserCreated: boolean }[];\n }): Promise<Array<{ id: string; index: number; value: string }>> {\n const mutation = `\n mutation SelectAssessmentQuestionAnswers($input: SelectAssessmentQuestionAnswerInput!) {\n selectAssessmentQuestionAnswers(input: $input) {\n selectedAnswers {\n id\n index\n value\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n selectAssessmentQuestionAnswers: {\n selectedAnswers: Array<{ id: string; index: number; value: string }>;\n };\n }>(mutation, { input });\n return data.selectAssessmentQuestionAnswers.selectedAnswers;\n }\n\n async updateAssessmentFormAssignees(input: {\n id: string;\n assigneeIds?: string[];\n externalAssigneeEmails?: string[];\n }): Promise<{ id: string; title: string; status: string }> {\n const mutation = `\n mutation UpdateAssessmentFormAssignees($input: UpdateAssessmentFormAssigneesInput!) {\n updateAssessmentFormAssignees(input: $input) {\n assessmentForm {\n id\n title\n status\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n updateAssessmentFormAssignees: {\n assessmentForm: { id: string; title: string; status: string };\n };\n }>(mutation, { input });\n return data.updateAssessmentFormAssignees.assessmentForm;\n }\n\n async listAssessmentGroups(options?: ListOptions): Promise<PaginatedResponse<AssessmentGroup>> {\n const query = `\n query ListAssessmentGroups($first: Int) {\n assessmentGroups(first: $first) {\n nodes {\n id\n title\n assessmentFormTemplate {\n id\n title\n }\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentGroups: { nodes: AssessmentGroup[]; totalCount: number };\n }>(query, { first: Math.min(options?.first || 50, 100) });\n return {\n nodes: data.assessmentGroups.nodes,\n pageInfo: {\n hasNextPage: data.assessmentGroups.nodes.length < data.assessmentGroups.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.assessmentGroups.totalCount,\n };\n }\n\n async createAssessmentGroup(input: {\n title: string;\n assessmentFormTemplateId: string;\n description?: string;\n isTriggerEnabled?: boolean;\n reviewerIds?: string[];\n }): Promise<{ id: string; title: string }> {\n const mutation = `\n mutation CreateAssessmentGroup($input: CreateAssessmentGroupInput!) {\n createAssessmentGroup(input: $input) {\n assessmentGroup {\n id\n title\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n createAssessmentGroup: { assessmentGroup: { id: string; title: string } };\n }>(mutation, { input });\n return data.createAssessmentGroup.assessmentGroup;\n }\n\n async createAssessment(input: AssessmentCreateInput): Promise<Assessment> {\n const mutation = `\n mutation CreateAssessmentForms($input: CreateAssessmentFormsInput!) {\n createAssessmentForms(input: $input) {\n assessmentForms {\n id\n title\n status\n createdAt\n }\n }\n }\n `;\n const batchInput = {\n assessmentForms: [\n {\n title: input.title,\n assessmentGroupId: input.assessmentGroupId,\n ...(input.assigneeIds && { assigneeIds: input.assigneeIds }),\n },\n ],\n };\n const data = await this.makeRequest<{\n createAssessmentForms: { assessmentForms: Assessment[] };\n }>(mutation, { input: batchInput });\n const created = data.createAssessmentForms.assessmentForms[0];\n if (!created) throw new Error('createAssessmentForms returned an empty array');\n // The mutation response doesn't echo `assessmentGroup`, but we know the\n // ID from the input — surface it so callers can build a deep link without\n // an extra round trip.\n return { ...created, assessmentGroupId: input.assessmentGroupId };\n }\n\n async updateAssessment(input: AssessmentUpdateInput): Promise<Assessment> {\n const mutation = `\n mutation UpdateAssessmentForm($input: UpdateAssessmentFormInput!) {\n updateAssessmentForm(input: $input) {\n assessmentForm {\n id\n title\n description\n status\n dueDate\n updatedAt\n assessmentGroup {\n id\n }\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n updateAssessmentForm: {\n assessmentForm: Omit<Assessment, 'assessmentGroupId'> & {\n assessmentGroup?: { id: string };\n };\n };\n }>(mutation, { input });\n const { assessmentGroup, ...rest } = data.updateAssessmentForm.assessmentForm;\n return { ...rest, assessmentGroupId: assessmentGroup?.id };\n }\n\n async listAssessmentTemplates(\n options?: ListOptions,\n ): Promise<PaginatedResponse<AssessmentTemplate>> {\n const query = `\n query ListAssessmentTemplates($first: Int) {\n assessmentFormTemplates(first: $first) {\n nodes {\n id\n title\n description\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentFormTemplates: {\n nodes: Array<{ id: string; title: string; description: string | null }>;\n totalCount: number;\n };\n }>(query, { first: Math.min(options?.first || 50, 100) });\n const templates: AssessmentTemplate[] = data.assessmentFormTemplates.nodes.map((t) => ({\n id: t.id,\n title: t.title,\n description: t.description || undefined,\n version: '1.0.0',\n isActive: true,\n createdAt: new Date().toISOString(),\n }));\n return {\n nodes: templates,\n pageInfo: {\n hasNextPage:\n data.assessmentFormTemplates.nodes.length < data.assessmentFormTemplates.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.assessmentFormTemplates.totalCount,\n };\n }\n\n async submitAssessmentForReview(input: AssessmentSubmitForReviewInput): Promise<Assessment> {\n const mutation = `\n mutation SubmitAssessmentFormForReview($input: SubmitAssessmentFormForReviewInput!) {\n submitAssessmentFormForReview(input: $input) {\n clientMutationId\n }\n }\n `;\n await this.makeRequest<{ submitAssessmentFormForReview: { clientMutationId?: string } }>(\n mutation,\n { input },\n );\n return this.getAssessment(input.id);\n }\n\n async createAssessmentFormTemplate(\n input: AssessmentTemplateCreateInput,\n ): Promise<{ id: string; title: string; status: string }> {\n const mutation = `\n mutation CreateAssessmentFormTemplate($input: CreateAssessmentFormTemplateInput!) {\n createAssessmentFormTemplate(input: $input) {\n assessmentFormTemplate {\n id\n title\n status\n sections {\n id\n title\n index\n questions {\n id\n title\n index\n type\n subType\n referenceId\n }\n }\n }\n }\n }\n `;\n const gqlInput: Record<string, unknown> = {\n title: input.title,\n description: input.description || '',\n status: input.status || 'DRAFT',\n source: input.source || 'MANUAL',\n };\n if (input.sections) {\n gqlInput.sections = input.sections.map((s) => ({\n title: s.title,\n questions: s.questions?.map(normalizeQuestion) || [],\n }));\n }\n const data = await this.makeRequest<{\n createAssessmentFormTemplate: {\n assessmentFormTemplate: {\n id: string;\n title: string;\n status: string;\n sections: Array<{\n id: string;\n title: string;\n index: number;\n questions: Array<{\n id: string;\n title: string;\n index: number;\n type: string;\n subType: string;\n referenceId: string;\n }>;\n }>;\n };\n };\n }>(mutation, { input: gqlInput });\n return data.createAssessmentFormTemplate.assessmentFormTemplate;\n }\n\n async createAssessmentSection(input: {\n assessmentFormTemplateId: string;\n title: string;\n questions?: AssessmentQuestionInput[];\n }): Promise<{ id: string; title: string; index: number }> {\n const mutation = `\n mutation CreateAssessmentSection($input: CreateAssessmentSectionInput!) {\n createAssessmentSection(input: $input) {\n assessmentSection {\n id\n title\n index\n questions {\n id\n title\n index\n type\n subType\n referenceId\n }\n }\n }\n }\n `;\n const gqlInput: Record<string, unknown> = {\n assessmentFormTemplateId: input.assessmentFormTemplateId,\n title: input.title,\n };\n if (input.questions) {\n gqlInput.questions = input.questions.map(normalizeQuestion);\n }\n const data = await this.makeRequest<{\n createAssessmentSection: {\n assessmentSection: {\n id: string;\n title: string;\n index: number;\n questions: Array<{\n id: string;\n title: string;\n index: number;\n type: string;\n subType: string;\n referenceId: string;\n }>;\n };\n };\n }>(mutation, { input: gqlInput });\n return data.createAssessmentSection.assessmentSection;\n }\n\n async createAssessmentQuestions(\n assessmentSectionId: string,\n questions: AssessmentQuestionInput[],\n ): Promise<\n Array<{\n id: string;\n title: string;\n index: number;\n type: string;\n subType: string;\n referenceId: string;\n }>\n > {\n const mutation = `\n mutation CreateAssessmentQuestions($input: [CreateAssessmentQuestionInput!]!) {\n createAssessmentQuestions(input: $input) {\n assessmentQuestions {\n id\n title\n index\n type\n subType\n referenceId\n }\n }\n }\n `;\n const input = questions.map((q) => ({\n title: q.title,\n type: q.type,\n subType: q.subType || 'NONE',\n placeholder: q.placeholder || '',\n description: q.description || '',\n isRequired: q.isRequired ?? false,\n referenceId: q.referenceId,\n assessmentSectionId,\n answerOptions: q.answerOptions || [],\n allowSelectOther: q.allowSelectOther ?? false,\n requireRiskEvaluation: q.requireRiskEvaluation ?? false,\n }));\n const data = await this.makeRequest<{\n createAssessmentQuestions: {\n assessmentQuestions: Array<{\n id: string;\n title: string;\n index: number;\n type: string;\n subType: string;\n referenceId: string;\n }>;\n };\n }>(mutation, { input });\n return data.createAssessmentQuestions.assessmentQuestions;\n }\n\n async getAssessmentFormTemplate(templateId: string): Promise<AssessmentTemplateExport> {\n const query = `\n query GetAssessmentFormTemplate($ids: [ID!]) {\n assessmentFormTemplates(first: 1, filterBy: { ids: $ids }) {\n nodes {\n id\n title\n description\n status\n source\n createdAt\n updatedAt\n sections {\n id\n title\n index\n questions {\n id\n title\n index\n type\n subType\n description\n placeholder\n isRequired\n referenceId\n allowSelectOther\n requireRiskEvaluation\n answerOptions {\n id\n index\n value\n }\n }\n }\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentFormTemplates: { nodes: AssessmentTemplateExport[] };\n }>(query, { ids: [templateId] });\n const node = data.assessmentFormTemplates.nodes[0];\n if (!node) {\n throw new Error(`Assessment template with id ${templateId} not found`);\n }\n return node;\n }\n}\n"],"mappings":";;;AAUA,MAAa,mBAAmB,EAAE,OAAO;CACvC,aAAa,EAAE,QAAQ,CAAC,SAAS,2DAA2D;CAC5F,OAAO,EAAE,QAAQ,CAAC,SAAS,2BAA2B;CACtD,WAAW,EACR,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC,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M,KAAK,YAgBrB,UAAU,EAAE,OAAO,UAAU,CAAC,EACrB,wBAAwB;;CAGtC,MAAM,0BACJ,qBACA,WAUA;EACA,MAAM,WAAW;;;;;;;;;;;;;;EAcjB,MAAM,QAAQ,UAAU,KAAK,OAAO;GAClC,OAAO,EAAE;GACT,MAAM,EAAE;GACR,SAAS,EAAE,WAAW;GACtB,aAAa,EAAE,eAAe;GAC9B,aAAa,EAAE,eAAe;GAC9B,YAAY,EAAE,cAAc;GAC5B,aAAa,EAAE;GACf;GACA,eAAe,EAAE,iBAAiB,EAAE;GACpC,kBAAkB,EAAE,oBAAoB;GACxC,uBAAuB,EAAE,yBAAyB;GACnD,EAAE;AAaH,UAZa,MAAM,KAAK,YAWrB,UAAU,EAAE,OAAO,CAAC,EACX,0BAA0B;;CAGxC,MAAM,0BAA0B,YAAuD;EA0CrF,MAAM,QAHO,MAAM,KAAK,YAtCV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCJ,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,EACd,wBAAwB,MAAM;AAChD,MAAI,CAAC,KACH,OAAM,IAAI,MAAM,+BAA+B,WAAW,YAAY;AAExE,SAAO"}
1
+ {"version":3,"file":"graphql-DMh8AG9n.mjs","names":[],"sources":["../src/tools/assessments_add_section.ts","../src/tools/assessments_answer_question.ts","../src/helpers/buildAssessmentLinks.ts","../src/tools/_helpers.ts","../src/tools/assessments_create.ts","../src/tools/assessments_create_group.ts","../src/tools/assessments_create_template.ts","../src/tools/assessments_export_template.ts","../src/tools/assessments_get.ts","../src/tools/assessments_list.ts","../src/tools/assessments_list_groups.ts","../src/tools/assessments_list_templates.ts","../src/tools/assessments_prefill.ts","../src/tools/assessments_submit_response.ts","../src/tools/assessments_update.ts","../src/tools/assessments_update_assignees.ts","../src/tools/index.ts","../src/graphql.ts"],"sourcesContent":["import {\n createToolResult,\n defineTool,\n z,\n type ToolClients,\n type AssessmentSectionInput,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const AddSectionSchema = z.object({\n template_id: z.string().describe('ID of the assessment form template to add the section to'),\n title: z.string().describe('Title of the new section'),\n questions: z\n .array(z.record(z.string(), z.unknown()))\n .optional()\n .describe(\n 'Array of question objects: [{title, type, subType?, description?, placeholder?, isRequired?, referenceId?, answerOptions?: [{value}], allowSelectOther?, requireRiskEvaluation?}]',\n ),\n});\nexport type AddSectionInput = z.infer<typeof AddSectionSchema>;\n\nexport function createAssessmentsAddSectionTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_add_section',\n description:\n 'Add a new section (with optional inline questions) to an existing assessment form template. ' +\n 'Useful for building templates incrementally or adding sections to imported templates. ' +\n 'Same auto-corrections as assessments_create_template apply to questions.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Adds a section to the assessment template',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: AddSectionSchema,\n handler: async ({ template_id, title, questions }) => {\n const result = await graphql.createAssessmentSection({\n assessmentFormTemplateId: template_id,\n title,\n questions: questions as AssessmentSectionInput['questions'],\n });\n\n return createToolResult(true, {\n section: result,\n message: `Section \"${title}\" added to template successfully`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const AnswerQuestionValueSchema = z.object({\n value: z.string(),\n isUserCreated: z.boolean(),\n});\nexport type AnswerQuestionValueInput = z.infer<typeof AnswerQuestionValueSchema>;\n\nexport const AnswerQuestionSchema = z.object({\n assessment_question_id: z.string().describe('ID of the assessment question to answer'),\n assessment_answer_ids: z\n .array(z.string())\n .optional()\n .describe(\n 'IDs of existing answer options to select (for SINGLE_SELECT/MULTI_SELECT questions)',\n ),\n assessment_answer_values: z\n .array(AnswerQuestionValueSchema)\n .optional()\n .describe(\n 'Free-text answer values to create and select (for text questions). Each item: {value: string, isUserCreated: boolean}',\n ),\n});\nexport type AnswerQuestionInput = z.infer<typeof AnswerQuestionSchema>;\n\nexport function createAssessmentsAnswerQuestionTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_answer_question',\n description:\n 'Answer an assessment question by selecting existing answer options or providing free-text values. For SINGLE_SELECT/MULTI_SELECT questions, provide assessmentAnswerIds from the answerOptions. For SHORT_ANSWER_TEXT/LONG_ANSWER_TEXT, provide assessmentAnswerValues with {value, isUserCreated: true}.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Records answer to the assessment question',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: AnswerQuestionSchema,\n handler: async ({\n assessment_question_id,\n assessment_answer_ids,\n assessment_answer_values,\n }) => {\n const input: {\n assessmentQuestionId: string;\n assessmentAnswerIds?: string[];\n assessmentAnswerValues?: { value: string; isUserCreated: boolean }[];\n } = {\n assessmentQuestionId: assessment_question_id,\n };\n\n if (assessment_answer_ids) {\n input.assessmentAnswerIds = assessment_answer_ids;\n }\n if (assessment_answer_values) {\n input.assessmentAnswerValues = assessment_answer_values;\n }\n\n const result = await graphql.selectAssessmentQuestionAnswers(input);\n\n return createToolResult(true, {\n selectedAnswers: result,\n message: 'Assessment question answered successfully',\n });\n },\n });\n}\n","/** Inputs to {@link buildAssessmentLinks}. */\nexport interface BuildAssessmentLinksInput {\n /** Base admin-dashboard URL (e.g. `https://app.transcend.io`) */\n dashboardUrl: string;\n /** The assessment form ID */\n assessmentFormId: string;\n}\n\n/** Deep link into the Transcend admin dashboard for a given assessment. */\nexport interface AssessmentLinks {\n /** Read-only response page for the assessment. */\n url: string;\n}\n\n/**\n * Build the canonical admin-dashboard deep link for an assessment.\n *\n * Always points at `/assessments/forms/:id/response`, mirroring the\n * dashboard's own \"View Responses\" row action. The fillable\n * `/assessments/forms/:id/view` route is intentionally not emitted —\n * it only resolves for the form's assignee, which the MCP can't verify.\n */\nexport function buildAssessmentLinks({\n dashboardUrl,\n assessmentFormId,\n}: BuildAssessmentLinksInput): AssessmentLinks {\n const base = dashboardUrl.replace(/\\/$/, '');\n return { url: `${base}/assessments/forms/${assessmentFormId}/response` };\n}\n\n/** Build a link to the assessment-group page (for group-level tools). */\nexport function buildAssessmentGroupUrl(dashboardUrl: string, assessmentGroupId: string): string {\n return `${dashboardUrl.replace(/\\/$/, '')}/assessments/groups/${assessmentGroupId}`;\n}\n","import { createToolResult } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\n/**\n * Resolves a template_id to an assessment group ID by searching through all groups.\n * Returns either the group ID or an error result.\n */\nexport async function resolveTemplateToGroupId(\n graphql: AssessmentsMixin,\n templateId: string,\n): Promise<{ groupId: string } | { error: ReturnType<typeof createToolResult> }> {\n const groups = await graphql.listAssessmentGroups({ first: 100 });\n const matchingGroups = groups.nodes.filter((g) => g.assessmentFormTemplate?.id === templateId);\n\n if (matchingGroups.length === 0) {\n return {\n error: createToolResult(\n false,\n undefined,\n `No assessment group found for template_id \"${templateId}\". Use assessments_list_groups to see available groups.`,\n ),\n };\n }\n\n if (matchingGroups.length > 1) {\n const ids = matchingGroups.map((g) => g.id).join(', ');\n return {\n error: createToolResult(\n false,\n undefined,\n `Multiple assessment groups found for template_id \"${templateId}\" (group IDs: ${ids}). ` +\n `Please specify assessment_group_id explicitly. Use assessments_list_groups to find available groups.`,\n ),\n };\n }\n\n return { groupId: matchingGroups[0]!.id };\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\nimport { resolveTemplateToGroupId } from './_helpers.js';\n\nexport const CreateAssessmentSchema = z.object({\n title: z.string().describe('Title of the assessment'),\n assessment_group_id: z\n .string()\n .optional()\n .describe(\n 'ID of the assessment group to create the assessment in (preferred). Use assessments_list_groups to find available groups.',\n ),\n template_id: z\n .string()\n .optional()\n .describe(\n 'ID of the assessment template. If assessment_group_id is not provided, the first group using this template will be used.',\n ),\n assignee_ids: z\n .array(z.string())\n .optional()\n .describe('Array of user IDs to assign the assessment to'),\n});\nexport type CreateAssessmentInput = z.infer<typeof CreateAssessmentSchema>;\n\nexport function createAssessmentsCreateTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_create',\n description:\n 'Create a new privacy assessment within an assessment group. Assessment groups are linked to templates. You can provide either an assessment_group_id directly, or a template_id to auto-resolve the first matching group. Use assessments_list_groups to find available groups. The response includes a `url` field with the canonical admin-dashboard link — surface that to the user verbatim and do not construct assessment URLs from raw IDs.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Creates a new privacy assessment',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: CreateAssessmentSchema,\n handler: async ({ title, assessment_group_id, template_id, assignee_ids }) => {\n let assessmentGroupId = assessment_group_id;\n\n if (!assessmentGroupId && template_id) {\n const resolved = await resolveTemplateToGroupId(graphql, template_id);\n if ('error' in resolved) return resolved.error;\n assessmentGroupId = resolved.groupId;\n }\n\n if (!assessmentGroupId) {\n return createToolResult(\n false,\n undefined,\n 'Either assessment_group_id or template_id must be provided. Use assessments_list_groups to find available groups.',\n );\n }\n\n const result = await graphql.createAssessment({\n title,\n assessmentGroupId,\n assigneeIds: assignee_ids,\n });\n\n const links = buildAssessmentLinks({ dashboardUrl, assessmentFormId: result.id });\n\n return createToolResult(true, {\n assessment: { ...result, ...links },\n ...links,\n message: `Assessment \"${title}\" created successfully. Open it at ${links.url}`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentGroupUrl } from '../helpers/buildAssessmentLinks.js';\n\nexport const CreateGroupSchema = z.object({\n title: z.string().describe('Title of the assessment group'),\n template_id: z.string().describe('ID of the assessment template to link this group to'),\n description: z.string().optional().describe('Description of the assessment group (optional)'),\n reviewer_ids: z\n .array(z.string())\n .optional()\n .describe('IDs of users assigned to review new assessments in this group (optional)'),\n});\nexport type CreateGroupInput = z.infer<typeof CreateGroupSchema>;\n\nexport function createAssessmentsCreateGroupTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_create_group',\n description:\n 'Create a new assessment group linked to a template. Assessment groups are containers for assessments. The response includes a `groupUrl` field with the canonical admin-dashboard link to the group — surface that to the user verbatim.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Creates a new assessment group',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: CreateGroupSchema,\n handler: async ({ title, template_id, description, reviewer_ids }) => {\n const result = await graphql.createAssessmentGroup({\n title,\n assessmentFormTemplateId: template_id,\n description,\n reviewerIds: reviewer_ids,\n });\n\n const groupUrl = buildAssessmentGroupUrl(dashboardUrl, result.id);\n\n return createToolResult(true, {\n assessmentGroup: { ...result, groupUrl },\n groupUrl,\n message: `Assessment group \"${title}\" created successfully. View it at ${groupUrl}`,\n });\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n z,\n type ToolClients,\n type AssessmentTemplateCreateInput,\n type AssessmentSectionInput,\n} from '@transcend-io/mcp-server-base';\nimport { AssessmentFormTemplateStatus } from '@transcend-io/privacy-types';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const CreateTemplateSchema = z.object({\n title: z.string().describe('Title of the assessment form template'),\n description: z.string().optional().describe('Description of the template'),\n status: z\n .nativeEnum(AssessmentFormTemplateStatus)\n .optional()\n .describe('Template status: DRAFT or PUBLISHED (default: DRAFT)'),\n sections: z\n .array(z.record(z.string(), z.unknown()))\n .optional()\n .describe('Array of section objects with title and optional questions array'),\n});\nexport type CreateTemplateInput = z.infer<typeof CreateTemplateSchema>;\n\nexport function createAssessmentsCreateTemplateTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_create_template',\n description:\n 'Create a new assessment form template with sections and questions inline. ' +\n 'This is the \"import\" side of the JSON import/export workflow. ' +\n 'You can provide the full template structure (sections with questions and answer options) in a single call. ' +\n 'Question types: LONG_ANSWER_TEXT, SHORT_ANSWER_TEXT, SINGLE_SELECT, MULTI_SELECT, FILE. ' +\n 'SubTypes: NONE, CUSTOM, USER, TEAM, DATA_SUB_CATEGORY, HAS_PERSONAL_DATA, ATTRIBUTE_KEY, SENSITIVE_CATEGORY. ' +\n 'Auto-corrections: referenceId is auto-generated as UUID if missing or not UUID format; ' +\n 'subType is auto-set to CUSTOM when allowSelectOther is true; ' +\n 'requireRiskEvaluation is ignored when no riskFrameworkId is provided.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Creates a new assessment form template',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: CreateTemplateSchema,\n handler: async ({ title, description, status, sections }) => {\n const input: AssessmentTemplateCreateInput = {\n title,\n description,\n status: status ?? 'DRAFT',\n sections: sections as AssessmentSectionInput[] | undefined,\n };\n\n const result = await graphql.createAssessmentFormTemplate(input);\n\n return createToolResult(true, {\n template: result,\n message: `Assessment template \"${title}\" created successfully`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const ExportTemplateSchema = z.object({\n template_id: z.string().describe('ID of the assessment form template to export'),\n});\nexport type ExportTemplateInput = z.infer<typeof ExportTemplateSchema>;\n\nexport function createAssessmentsExportTemplateTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_export_template',\n description:\n 'Export a full assessment form template as JSON, including all sections, questions, answer options, ' +\n 'and configuration. This is the \"export\" side of the JSON import/export workflow. ' +\n 'The output can be used as input for assessments_create_template to recreate the template elsewhere.',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ExportTemplateSchema,\n handler: async ({ template_id }) => {\n const template = await graphql.getAssessmentFormTemplate(template_id);\n\n const exportData = {\n _exportedAt: new Date().toISOString(),\n _format: 'transcend-assessment-template-v1',\n template: {\n title: template.title,\n description: template.description,\n status: template.status,\n sections: template.sections.map((section) => ({\n title: section.title,\n questions: section.questions.map((q) => ({\n title: q.title,\n type: q.type,\n subType: q.subType,\n description: q.description,\n placeholder: q.placeholder,\n isRequired: q.isRequired,\n referenceId: q.referenceId,\n allowSelectOther: q.allowSelectOther,\n requireRiskEvaluation: q.requireRiskEvaluation,\n answerOptions: q.answerOptions.map((opt) => ({\n value: opt.value,\n })),\n })),\n })),\n },\n _raw: template,\n };\n\n return createToolResult(true, exportData);\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\n\nexport const GetAssessmentSchema = z.object({\n assessment_id: z.string().describe('ID of the assessment to retrieve'),\n assessment_name: z\n .string()\n .optional()\n .describe(\n 'Optional human-readable name (e.g. title) for the tool call in chat; not sent to the API.',\n ),\n});\nexport type GetAssessmentInput = z.infer<typeof GetAssessmentSchema>;\n\nexport function createAssessmentsGetTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_get',\n description:\n 'Get detailed information about a specific assessment including questions and responses. The response includes a `url` field with the canonical admin-dashboard link — surface that to the user verbatim and do not construct assessment URLs from raw IDs.',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: GetAssessmentSchema,\n handler: async ({ assessment_id }) => {\n const result = await graphql.getAssessment(assessment_id);\n const links = buildAssessmentLinks({ dashboardUrl, assessmentFormId: result.id });\n return createToolResult(true, { ...result, ...links });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n z,\n PaginationSchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\nimport { AssessmentFormStatus } from '@transcend-io/privacy-types';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\n\nexport const AssessmentStatusEnum = z.nativeEnum(AssessmentFormStatus);\nexport type AssessmentStatusEnumInput = z.infer<typeof AssessmentStatusEnum>;\n\nexport const ListAssessmentsSchema = z\n .object({\n status: AssessmentStatusEnum.optional().describe('Filter by assessment status'),\n })\n .merge(PaginationSchema);\nexport type ListAssessmentsInput = z.infer<typeof ListAssessmentsSchema>;\n\nexport function createAssessmentsListTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_list',\n description:\n 'List all privacy assessments in your organization. Supports filtering by status. Each row includes a `url` field with the canonical admin-dashboard link for that assessment — surface those to the user verbatim and do not construct assessment URLs from raw IDs. Note: Cursor pagination is not supported (max 100 results).',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListAssessmentsSchema,\n handler: async ({ status, limit, cursor }) => {\n const result = await graphql.listAssessments({\n first: limit,\n after: cursor,\n filterBy: status ? { statuses: [status] } : undefined,\n });\n\n const nodesWithLinks = result.nodes.map((node) => ({\n ...node,\n ...buildAssessmentLinks({ dashboardUrl, assessmentFormId: node.id }),\n }));\n\n return createListResult(nodesWithLinks, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentGroupUrl } from '../helpers/buildAssessmentLinks.js';\n\nexport const ListGroupsSchema = PaginationSchema;\nexport type ListGroupsInput = z.infer<typeof ListGroupsSchema>;\n\nexport function createAssessmentsListGroupsTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_list_groups',\n description:\n 'List all assessment groups. Groups are containers for assessments and are linked to templates. Use this to find the right group ID for creating assessments. Each row includes a `groupUrl` field with the canonical admin-dashboard link — surface those to the user verbatim.',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListGroupsSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listAssessmentGroups({\n first: limit,\n after: cursor,\n });\n\n const nodesWithLinks = result.nodes.map((node) => ({\n ...node,\n groupUrl: buildAssessmentGroupUrl(dashboardUrl, node.id),\n }));\n\n return createListResult(nodesWithLinks, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createListResult,\n defineTool,\n PaginationSchema,\n z,\n type ToolClients,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const ListTemplatesSchema = PaginationSchema;\nexport type ListTemplatesInput = z.infer<typeof ListTemplatesSchema>;\n\nexport function createAssessmentsListTemplatesTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_list_templates',\n description:\n 'List all available assessment templates. Note: Cursor pagination is not supported by the Transcend API for templates - use limit to control results (max 100).',\n category: 'Assessments',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListTemplatesSchema,\n handler: async ({ limit, cursor }) => {\n const result = await graphql.listAssessmentTemplates({\n first: limit,\n after: cursor,\n });\n\n return createListResult(result.nodes, {\n totalCount: result.totalCount,\n hasNextPage: result.pageInfo?.hasNextPage,\n });\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n z,\n type ToolClients,\n type Assessment,\n type AssessmentSection,\n} from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { resolveTemplateToGroupId } from './_helpers.js';\n\nexport const PrefillSchema = z.object({\n title: z.string().describe('Title for the new assessment form'),\n template_id: z\n .string()\n .optional()\n .describe(\n 'Template ID to create the form from. Will auto-resolve to the first matching assessment group.',\n ),\n assessment_group_id: z\n .string()\n .optional()\n .describe('Assessment group ID (alternative to template_id)'),\n answers: z\n .record(z.string(), z.union([z.string(), z.array(z.string())]))\n .describe(\n 'Map of answers keyed by question title or referenceId. Values should be strings for text/single-select, or arrays of strings for multi-select.',\n ),\n assignee_ids: z\n .array(z.string())\n .optional()\n .describe('Internal user IDs to assign the form to (optional)'),\n assignee_emails: z\n .array(z.string())\n .optional()\n .describe('External email addresses to assign the form to (optional)'),\n reviewer_ids: z.array(z.string()).optional().describe('User IDs to set as reviewers (optional)'),\n submit_for_review: z\n .boolean()\n .optional()\n .describe(\n 'Whether to automatically submit the form for review after prefilling (default: false)',\n ),\n});\nexport type PrefillInput = z.infer<typeof PrefillSchema>;\n\nexport function createAssessmentsPrefillTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_prefill',\n description:\n 'Convenience tool: Create a new assessment form, AI-prefill all the answers, and assign it to a reviewer. ' +\n 'Combines: create form → get questions → answer each question → assign reviewers → optionally submit for review. ' +\n 'Provide answers as a map of {questionTitle: answer} or {referenceId: answer}. ' +\n 'For SINGLE_SELECT/MULTI_SELECT, the answer should match the exact text of the answer option(s). ' +\n 'For text questions, provide the free-text answer string. ' +\n 'For multi-select, provide an array of answer option values.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Creates assessment, prefills answers, assigns reviewers',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false },\n zodSchema: PrefillSchema,\n handler: async ({\n answers,\n title,\n assessment_group_id,\n template_id,\n assignee_ids,\n assignee_emails,\n reviewer_ids,\n submit_for_review,\n }) => {\n let assessmentGroupId = assessment_group_id;\n if (!assessmentGroupId && template_id) {\n const resolved = await resolveTemplateToGroupId(graphql, template_id);\n if ('error' in resolved) return resolved.error;\n assessmentGroupId = resolved.groupId;\n }\n if (!assessmentGroupId) {\n return createToolResult(\n false,\n undefined,\n 'Either template_id or assessment_group_id is required.',\n );\n }\n\n const assessment = await graphql.createAssessment({\n title,\n assessmentGroupId,\n });\n const assessmentId = assessment.id;\n\n const fullForm = await graphql.getAssessment(assessmentId);\n if (!fullForm.sections || fullForm.sections.length === 0) {\n return createToolResult(true, {\n assessment: fullForm,\n message: 'Assessment created but has no sections/questions to prefill.',\n answersApplied: 0,\n });\n }\n\n const results: { question: string; status: string; answer?: string }[] = [];\n let answersApplied = 0;\n let answersSkipped = 0;\n\n for (const section of fullForm.sections as AssessmentSection[]) {\n if (!section.questions) continue;\n\n for (const question of section.questions) {\n const answerKey = Object.keys(answers).find(\n (key) =>\n key === question.referenceId ||\n key.toLowerCase() === (question.title || '').toLowerCase() ||\n key === question.id,\n );\n\n if (!answerKey) {\n results.push({\n question: question.title || question.id,\n status: 'skipped',\n });\n answersSkipped++;\n continue;\n }\n\n const answerValue = answers[answerKey];\n if (answerValue === undefined) {\n results.push({\n question: question.title || question.id,\n status: 'skipped',\n });\n answersSkipped++;\n continue;\n }\n\n try {\n const qType = (question.type || '').toUpperCase();\n\n if (qType === 'SINGLE_SELECT' || qType === 'MULTI_SELECT') {\n const answerValues = Array.isArray(answerValue) ? answerValue : [answerValue];\n const matchedIds: string[] = [];\n\n for (const val of answerValues) {\n const matchedOption = (question.answerOptions || []).find(\n (opt) => opt.value.toLowerCase() === val.toLowerCase(),\n );\n if (matchedOption) {\n matchedIds.push(matchedOption.id);\n }\n }\n\n if (matchedIds.length > 0) {\n await graphql.selectAssessmentQuestionAnswers({\n assessmentQuestionId: question.id,\n assessmentAnswerIds: matchedIds,\n });\n answersApplied++;\n results.push({\n question: question.title || question.id,\n status: 'answered',\n answer: answerValues.join(', '),\n });\n } else {\n await graphql.selectAssessmentQuestionAnswers({\n assessmentQuestionId: question.id,\n assessmentAnswerValues: answerValues.map((v) => ({\n value: v,\n isUserCreated: true,\n })),\n });\n answersApplied++;\n results.push({\n question: question.title || question.id,\n status: 'answered (custom value)',\n answer: answerValues.join(', '),\n });\n }\n } else {\n const textValue = Array.isArray(answerValue) ? answerValue.join('\\n') : answerValue;\n await graphql.selectAssessmentQuestionAnswers({\n assessmentQuestionId: question.id,\n assessmentAnswerValues: [{ value: textValue, isUserCreated: true }],\n });\n answersApplied++;\n results.push({\n question: question.title || question.id,\n status: 'answered',\n answer: textValue.length > 100 ? textValue.substring(0, 100) + '...' : textValue,\n });\n }\n } catch (err) {\n results.push({\n question: question.title || question.id,\n status: `error: ${err instanceof Error ? err.message : String(err)}`,\n });\n }\n }\n }\n\n let assignmentResult: Record<string, unknown> | null = null;\n if (assignee_ids || assignee_emails) {\n assignmentResult = await graphql.updateAssessmentFormAssignees({\n id: assessmentId,\n assigneeIds: assignee_ids,\n externalAssigneeEmails: assignee_emails,\n });\n }\n\n if (reviewer_ids) {\n await graphql.updateAssessment({\n id: assessmentId,\n reviewerIds: reviewer_ids,\n });\n }\n\n let submitResult: Assessment | null = null;\n if (submit_for_review) {\n const sectionIds = (fullForm.sections as AssessmentSection[]).map((s) => s.id);\n if (sectionIds.length > 0) {\n submitResult = await graphql.submitAssessmentForReview({\n id: assessmentId,\n assessmentSectionIds: sectionIds,\n });\n }\n }\n\n return createToolResult(true, {\n assessmentId,\n title,\n answersApplied,\n answersSkipped,\n totalQuestions: results.length,\n results,\n assignment: assignmentResult\n ? {\n status: assignmentResult.status,\n message: 'Assignees updated',\n }\n : null,\n submittedForReview: !!submitResult,\n message:\n `Assessment \"${title}\" created and prefilled with ${answersApplied}/${results.length} answers. ` +\n (assignmentResult ? `Assigned to reviewers. ` : '') +\n (submitResult ? 'Submitted for review.' : 'Ready for manual submission.'),\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\n\nexport const SubmitResponseSchema = z.object({\n assessment_id: z.string().describe('ID of the assessment to submit for review'),\n assessment_section_ids: z\n .array(z.string())\n .describe('Array of section IDs to submit for review. Required by the API.'),\n});\nexport type SubmitResponseInput = z.infer<typeof SubmitResponseSchema>;\n\nexport function createAssessmentsSubmitResponseTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_submit_response',\n description:\n 'Submit an assessment form for review. Optionally specify which sections to submit. This transitions the assessment toward the IN_REVIEW status. The response includes a `url` field pointing at the assessment-group page where reviewers can find the submitted form — surface that to the user verbatim and do not construct assessment URLs from raw IDs.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Submits assessment for review — cannot be undone',\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },\n zodSchema: SubmitResponseSchema,\n handler: async ({ assessment_id, assessment_section_ids }) => {\n const result = await graphql.submitAssessmentForReview({\n id: assessment_id,\n assessmentSectionIds: assessment_section_ids,\n });\n\n const links = buildAssessmentLinks({ dashboardUrl, assessmentFormId: result.id });\n\n return createToolResult(true, {\n assessment: { ...result, ...links },\n ...links,\n message: `Assessment submitted for review successfully. View it at ${links.url}`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\nimport { buildAssessmentLinks } from '../helpers/buildAssessmentLinks.js';\nimport { AssessmentStatusEnum } from './assessments_list.js';\n\nexport const UpdateAssessmentSchema = z.object({\n assessment_id: z.string().describe('ID of the assessment to update'),\n title: z.string().optional().describe('New title for the assessment'),\n description: z.string().optional().describe('New description'),\n reviewer_ids: z\n .array(z.string())\n .optional()\n .describe('IDs of users assigned to review this assessment'),\n due_date: z.string().optional().describe('New due date (ISO format)'),\n status: AssessmentStatusEnum.optional().describe('New status'),\n});\nexport type UpdateAssessmentInput = z.infer<typeof UpdateAssessmentSchema>;\n\nexport function createAssessmentsUpdateTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n const { dashboardUrl } = clients;\n return defineTool({\n name: 'assessments_update',\n description:\n 'Update an existing assessment. The response includes a `url` field with the canonical admin-dashboard link — surface that to the user verbatim and do not construct assessment URLs from raw IDs.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Updates the assessment',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: UpdateAssessmentSchema,\n handler: async ({ assessment_id, title, description, reviewer_ids, due_date, status }) => {\n const result = await graphql.updateAssessment({\n id: assessment_id,\n title,\n description,\n reviewerIds: reviewer_ids,\n dueDate: due_date,\n status,\n });\n\n const links = buildAssessmentLinks({ dashboardUrl, assessmentFormId: result.id });\n\n return createToolResult(true, {\n assessment: { ...result, ...links },\n ...links,\n message: `Assessment updated successfully. View it at ${links.url}`,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-base';\n\nimport type { AssessmentsMixin } from '../graphql.js';\n\nexport const UpdateAssigneesSchema = z.object({\n assessment_id: z.string().describe('ID of the assessment form to update assignees for'),\n assignee_ids: z\n .array(z.string())\n .optional()\n .describe('Array of internal user IDs to assign to the assessment'),\n external_assignee_emails: z\n .array(z.string())\n .optional()\n .describe('Array of external email addresses to assign to the assessment'),\n});\nexport type UpdateAssigneesInput = z.infer<typeof UpdateAssigneesSchema>;\n\nexport function createAssessmentsUpdateAssigneesTool(clients: ToolClients) {\n const graphql = clients.graphql as AssessmentsMixin;\n return defineTool({\n name: 'assessments_update_assignees',\n description:\n 'Assign internal users (by ID) or external users (by email) to an assessment form. This also transitions DRAFT assessments to SHARED status.',\n category: 'Assessments',\n readOnly: false,\n confirmationHint: 'Assigns users to the assessment form',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: UpdateAssigneesSchema,\n handler: async ({ assessment_id, assignee_ids, external_assignee_emails }) => {\n const result = await graphql.updateAssessmentFormAssignees({\n id: assessment_id,\n assigneeIds: assignee_ids,\n externalAssigneeEmails: external_assignee_emails,\n });\n\n return createToolResult(true, {\n assessment: result,\n message: `Assessment assignees updated successfully. Status: ${result.status}`,\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-base';\n\nimport { createAssessmentsAddSectionTool } from './assessments_add_section.js';\nimport { createAssessmentsAnswerQuestionTool } from './assessments_answer_question.js';\nimport { createAssessmentsCreateTool } from './assessments_create.js';\nimport { createAssessmentsCreateGroupTool } from './assessments_create_group.js';\nimport { createAssessmentsCreateTemplateTool } from './assessments_create_template.js';\nimport { createAssessmentsExportTemplateTool } from './assessments_export_template.js';\nimport { createAssessmentsGetTool } from './assessments_get.js';\nimport { createAssessmentsListTool } from './assessments_list.js';\nimport { createAssessmentsListGroupsTool } from './assessments_list_groups.js';\nimport { createAssessmentsListTemplatesTool } from './assessments_list_templates.js';\nimport { createAssessmentsPrefillTool } from './assessments_prefill.js';\nimport { createAssessmentsSubmitResponseTool } from './assessments_submit_response.js';\nimport { createAssessmentsUpdateTool } from './assessments_update.js';\nimport { createAssessmentsUpdateAssigneesTool } from './assessments_update_assignees.js';\n\nexport function getAssessmentTools(clients: ToolClients): ToolDefinition[] {\n return [\n createAssessmentsListTool(clients),\n createAssessmentsGetTool(clients),\n createAssessmentsCreateTool(clients),\n createAssessmentsCreateGroupTool(clients),\n createAssessmentsListGroupsTool(clients),\n createAssessmentsUpdateTool(clients),\n createAssessmentsListTemplatesTool(clients),\n createAssessmentsUpdateAssigneesTool(clients),\n createAssessmentsAnswerQuestionTool(clients),\n createAssessmentsSubmitResponseTool(clients),\n createAssessmentsCreateTemplateTool(clients),\n createAssessmentsAddSectionTool(clients),\n createAssessmentsExportTemplateTool(clients),\n createAssessmentsPrefillTool(clients),\n ];\n}\n","import {\n TranscendGraphQLBase,\n type PaginatedResponse,\n type Assessment,\n type AssessmentTemplate,\n type AssessmentGroup,\n type AssessmentCreateInput,\n type AssessmentUpdateInput,\n type AssessmentSubmitForReviewInput,\n type AssessmentTemplateCreateInput,\n type AssessmentTemplateExport,\n type AssessmentQuestionInput,\n type ListOptions,\n} from '@transcend-io/mcp-server-base';\n\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\nfunction generateUUID(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n\nfunction normalizeQuestion(q: AssessmentQuestionInput): Record<string, unknown> {\n let { referenceId, subType, allowSelectOther, requireRiskEvaluation } = q;\n\n if (!referenceId || !UUID_RE.test(referenceId)) {\n referenceId = generateUUID();\n }\n\n if (allowSelectOther && (!subType || subType === 'NONE')) {\n subType = 'CUSTOM';\n }\n\n if (requireRiskEvaluation && !q.riskFrameworkId) {\n requireRiskEvaluation = false;\n }\n\n return {\n title: q.title,\n type: q.type,\n subType: subType || 'NONE',\n placeholder: q.placeholder || '',\n description: q.description || '',\n isRequired: q.isRequired ?? false,\n referenceId,\n answerOptions: q.answerOptions || [],\n allowSelectOther: allowSelectOther ?? false,\n requireRiskEvaluation: requireRiskEvaluation ?? false,\n ...(q.riskLogic && { riskLogic: q.riskLogic }),\n ...(q.riskCategoryIds && { riskCategoryIds: q.riskCategoryIds }),\n ...(q.riskFrameworkId && { riskFrameworkId: q.riskFrameworkId }),\n ...(q.displayLogic && { displayLogic: q.displayLogic }),\n };\n}\n\nexport class AssessmentsMixin extends TranscendGraphQLBase {\n async listAssessments(\n options?: ListOptions & { filterBy?: { statuses?: string[] } },\n ): Promise<PaginatedResponse<Assessment>> {\n const query = `\n query ListAssessments($first: Int, $filterBy: AssessmentFormFiltersInput) {\n assessmentForms(first: $first, filterBy: $filterBy) {\n nodes {\n id\n title\n status\n createdAt\n assessmentGroup {\n id\n }\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentForms: {\n nodes: Array<Omit<Assessment, 'assessmentGroupId'> & { assessmentGroup?: { id: string } }>;\n totalCount: number;\n };\n }>(query, {\n first: Math.min(options?.first || 50, 100),\n filterBy: options?.filterBy?.statuses ? { statuses: options.filterBy.statuses } : undefined,\n });\n return {\n nodes: data.assessmentForms.nodes.map(({ assessmentGroup, ...rest }) => ({\n ...rest,\n assessmentGroupId: assessmentGroup?.id,\n })),\n pageInfo: {\n hasNextPage: data.assessmentForms.nodes.length < data.assessmentForms.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.assessmentForms.totalCount,\n };\n }\n\n async getAssessment(id: string): Promise<Assessment> {\n const query = `\n query GetAssessment($ids: [ID!]!) {\n assessmentForms(first: 1, filterBy: { ids: $ids }) {\n nodes {\n id\n title\n status\n dueDate\n submittedAt\n createdAt\n updatedAt\n assessmentGroup {\n id\n }\n sections {\n id\n title\n index\n status\n questions {\n id\n title\n index\n type\n subType\n description\n isRequired\n placeholder\n answerOptions {\n id\n index\n value\n }\n selectedAnswers {\n id\n index\n value\n }\n }\n }\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentForms: {\n nodes: Array<Omit<Assessment, 'assessmentGroupId'> & { assessmentGroup?: { id: string } }>;\n };\n }>(query, { ids: [id] });\n const node = data.assessmentForms.nodes[0];\n if (!node) {\n throw new Error(`Assessment with id ${id} not found`);\n }\n const { assessmentGroup, ...rest } = node;\n return { ...rest, assessmentGroupId: assessmentGroup?.id };\n }\n\n async selectAssessmentQuestionAnswers(input: {\n assessmentQuestionId: string;\n assessmentAnswerIds?: string[];\n assessmentAnswerValues?: { value: string; isUserCreated: boolean }[];\n }): Promise<Array<{ id: string; index: number; value: string }>> {\n const mutation = `\n mutation SelectAssessmentQuestionAnswers($input: SelectAssessmentQuestionAnswerInput!) {\n selectAssessmentQuestionAnswers(input: $input) {\n selectedAnswers {\n id\n index\n value\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n selectAssessmentQuestionAnswers: {\n selectedAnswers: Array<{ id: string; index: number; value: string }>;\n };\n }>(mutation, { input });\n return data.selectAssessmentQuestionAnswers.selectedAnswers;\n }\n\n async updateAssessmentFormAssignees(input: {\n id: string;\n assigneeIds?: string[];\n externalAssigneeEmails?: string[];\n }): Promise<{ id: string; title: string; status: string }> {\n const mutation = `\n mutation UpdateAssessmentFormAssignees($input: UpdateAssessmentFormAssigneesInput!) {\n updateAssessmentFormAssignees(input: $input) {\n assessmentForm {\n id\n title\n status\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n updateAssessmentFormAssignees: {\n assessmentForm: { id: string; title: string; status: string };\n };\n }>(mutation, { input });\n return data.updateAssessmentFormAssignees.assessmentForm;\n }\n\n async listAssessmentGroups(options?: ListOptions): Promise<PaginatedResponse<AssessmentGroup>> {\n const query = `\n query ListAssessmentGroups($first: Int) {\n assessmentGroups(first: $first) {\n nodes {\n id\n title\n assessmentFormTemplate {\n id\n title\n }\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentGroups: { nodes: AssessmentGroup[]; totalCount: number };\n }>(query, { first: Math.min(options?.first || 50, 100) });\n return {\n nodes: data.assessmentGroups.nodes,\n pageInfo: {\n hasNextPage: data.assessmentGroups.nodes.length < data.assessmentGroups.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.assessmentGroups.totalCount,\n };\n }\n\n async createAssessmentGroup(input: {\n title: string;\n assessmentFormTemplateId: string;\n description?: string;\n isTriggerEnabled?: boolean;\n reviewerIds?: string[];\n }): Promise<{ id: string; title: string }> {\n const mutation = `\n mutation CreateAssessmentGroup($input: CreateAssessmentGroupInput!) {\n createAssessmentGroup(input: $input) {\n assessmentGroup {\n id\n title\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n createAssessmentGroup: { assessmentGroup: { id: string; title: string } };\n }>(mutation, { input });\n return data.createAssessmentGroup.assessmentGroup;\n }\n\n async createAssessment(input: AssessmentCreateInput): Promise<Assessment> {\n const mutation = `\n mutation CreateAssessmentForms($input: CreateAssessmentFormsInput!) {\n createAssessmentForms(input: $input) {\n assessmentForms {\n id\n title\n status\n createdAt\n }\n }\n }\n `;\n const batchInput = {\n assessmentForms: [\n {\n title: input.title,\n assessmentGroupId: input.assessmentGroupId,\n ...(input.assigneeIds && { assigneeIds: input.assigneeIds }),\n },\n ],\n };\n const data = await this.makeRequest<{\n createAssessmentForms: { assessmentForms: Assessment[] };\n }>(mutation, { input: batchInput });\n const created = data.createAssessmentForms.assessmentForms[0];\n if (!created) throw new Error('createAssessmentForms returned an empty array');\n // The mutation response doesn't echo `assessmentGroup`, but we know the\n // ID from the input — surface it so callers can build a deep link without\n // an extra round trip.\n return { ...created, assessmentGroupId: input.assessmentGroupId };\n }\n\n async updateAssessment(input: AssessmentUpdateInput): Promise<Assessment> {\n const mutation = `\n mutation UpdateAssessmentForm($input: UpdateAssessmentFormInput!) {\n updateAssessmentForm(input: $input) {\n assessmentForm {\n id\n title\n description\n status\n dueDate\n updatedAt\n assessmentGroup {\n id\n }\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n updateAssessmentForm: {\n assessmentForm: Omit<Assessment, 'assessmentGroupId'> & {\n assessmentGroup?: { id: string };\n };\n };\n }>(mutation, { input });\n const { assessmentGroup, ...rest } = data.updateAssessmentForm.assessmentForm;\n return { ...rest, assessmentGroupId: assessmentGroup?.id };\n }\n\n async listAssessmentTemplates(\n options?: ListOptions,\n ): Promise<PaginatedResponse<AssessmentTemplate>> {\n const query = `\n query ListAssessmentTemplates($first: Int) {\n assessmentFormTemplates(first: $first) {\n nodes {\n id\n title\n description\n }\n totalCount\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentFormTemplates: {\n nodes: Array<{ id: string; title: string; description: string | null }>;\n totalCount: number;\n };\n }>(query, { first: Math.min(options?.first || 50, 100) });\n const templates: AssessmentTemplate[] = data.assessmentFormTemplates.nodes.map((t) => ({\n id: t.id,\n title: t.title,\n description: t.description || undefined,\n version: '1.0.0',\n isActive: true,\n createdAt: new Date().toISOString(),\n }));\n return {\n nodes: templates,\n pageInfo: {\n hasNextPage:\n data.assessmentFormTemplates.nodes.length < data.assessmentFormTemplates.totalCount,\n hasPreviousPage: false,\n },\n totalCount: data.assessmentFormTemplates.totalCount,\n };\n }\n\n async submitAssessmentForReview(input: AssessmentSubmitForReviewInput): Promise<Assessment> {\n const mutation = `\n mutation SubmitAssessmentFormForReview($input: SubmitAssessmentFormForReviewInput!) {\n submitAssessmentFormForReview(input: $input) {\n clientMutationId\n }\n }\n `;\n await this.makeRequest<{ submitAssessmentFormForReview: { clientMutationId?: string } }>(\n mutation,\n { input },\n );\n return this.getAssessment(input.id);\n }\n\n async createAssessmentFormTemplate(\n input: AssessmentTemplateCreateInput,\n ): Promise<{ id: string; title: string; status: string }> {\n const mutation = `\n mutation CreateAssessmentFormTemplate($input: CreateAssessmentFormTemplateInput!) {\n createAssessmentFormTemplate(input: $input) {\n assessmentFormTemplate {\n id\n title\n status\n sections {\n id\n title\n index\n questions {\n id\n title\n index\n type\n subType\n referenceId\n }\n }\n }\n }\n }\n `;\n const gqlInput: Record<string, unknown> = {\n title: input.title,\n description: input.description || '',\n status: input.status || 'DRAFT',\n source: input.source || 'MANUAL',\n };\n if (input.sections) {\n gqlInput.sections = input.sections.map((s) => ({\n title: s.title,\n questions: s.questions?.map(normalizeQuestion) || [],\n }));\n }\n const data = await this.makeRequest<{\n createAssessmentFormTemplate: {\n assessmentFormTemplate: {\n id: string;\n title: string;\n status: string;\n sections: Array<{\n id: string;\n title: string;\n index: number;\n questions: Array<{\n id: string;\n title: string;\n index: number;\n type: string;\n subType: string;\n referenceId: string;\n }>;\n }>;\n };\n };\n }>(mutation, { input: gqlInput });\n return data.createAssessmentFormTemplate.assessmentFormTemplate;\n }\n\n async createAssessmentSection(input: {\n assessmentFormTemplateId: string;\n title: string;\n questions?: AssessmentQuestionInput[];\n }): Promise<{ id: string; title: string; index: number }> {\n const mutation = `\n mutation CreateAssessmentSection($input: CreateAssessmentSectionInput!) {\n createAssessmentSection(input: $input) {\n assessmentSection {\n id\n title\n index\n questions {\n id\n title\n index\n type\n subType\n referenceId\n }\n }\n }\n }\n `;\n const gqlInput: Record<string, unknown> = {\n assessmentFormTemplateId: input.assessmentFormTemplateId,\n title: input.title,\n };\n if (input.questions) {\n gqlInput.questions = input.questions.map(normalizeQuestion);\n }\n const data = await this.makeRequest<{\n createAssessmentSection: {\n assessmentSection: {\n id: string;\n title: string;\n index: number;\n questions: Array<{\n id: string;\n title: string;\n index: number;\n type: string;\n subType: string;\n referenceId: string;\n }>;\n };\n };\n }>(mutation, { input: gqlInput });\n return data.createAssessmentSection.assessmentSection;\n }\n\n async createAssessmentQuestions(\n assessmentSectionId: string,\n questions: AssessmentQuestionInput[],\n ): Promise<\n Array<{\n id: string;\n title: string;\n index: number;\n type: string;\n subType: string;\n referenceId: string;\n }>\n > {\n const mutation = `\n mutation CreateAssessmentQuestions($input: [CreateAssessmentQuestionInput!]!) {\n createAssessmentQuestions(input: $input) {\n assessmentQuestions {\n id\n title\n index\n type\n subType\n referenceId\n }\n }\n }\n `;\n const input = questions.map((q) => ({\n title: q.title,\n type: q.type,\n subType: q.subType || 'NONE',\n placeholder: q.placeholder || '',\n description: q.description || '',\n isRequired: q.isRequired ?? false,\n referenceId: q.referenceId,\n assessmentSectionId,\n answerOptions: q.answerOptions || [],\n allowSelectOther: q.allowSelectOther ?? false,\n requireRiskEvaluation: q.requireRiskEvaluation ?? false,\n }));\n const data = await this.makeRequest<{\n createAssessmentQuestions: {\n assessmentQuestions: Array<{\n id: string;\n title: string;\n index: number;\n type: string;\n subType: string;\n referenceId: string;\n }>;\n };\n }>(mutation, { input });\n return data.createAssessmentQuestions.assessmentQuestions;\n }\n\n async getAssessmentFormTemplate(templateId: string): Promise<AssessmentTemplateExport> {\n const query = `\n query GetAssessmentFormTemplate($ids: [ID!]) {\n assessmentFormTemplates(first: 1, filterBy: { ids: $ids }) {\n nodes {\n id\n title\n description\n status\n source\n createdAt\n updatedAt\n sections {\n id\n title\n index\n questions {\n id\n title\n index\n type\n subType\n description\n placeholder\n isRequired\n referenceId\n allowSelectOther\n requireRiskEvaluation\n answerOptions {\n id\n index\n value\n }\n }\n }\n }\n }\n }\n `;\n const data = await this.makeRequest<{\n assessmentFormTemplates: { nodes: AssessmentTemplateExport[] };\n }>(query, { ids: [templateId] });\n const node = data.assessmentFormTemplates.nodes[0];\n if (!node) {\n throw new Error(`Assessment template with id ${templateId} not found`);\n }\n return node;\n }\n}\n"],"mappings":";;;AAUA,MAAa,mBAAmB,EAAE,OAAO;CACvC,aAAa,EAAE,QAAQ,CAAC,SAAS,2DAA2D;CAC5F,OAAO,EAAE,QAAQ,CAAC,SAAS,2BAA2B;CACtD,WAAW,EACR,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC,CACxC,UAAU,CACV,SACC,oLACD;CACJ,CAAC;AAGF,SAAgB,gCAAgC,SAAsB;CACpE,MAAM,UAAU,QAAQ;AACxB,QAAO,WAAW;EAChB,MAAM;EACN,aACE;EAGF,UAAU;EACV,UAAU;EACV,kBAAkB;EAClB,aAAa;GAAE,cAAc;GAAO,iBAAiB;GAAO,gBAAgB;GAAO;EACnF,WAAW;EACX,SAAS,OAAO,EAAE,aAAa,OAAO,gBAAgB;AAOpD,UAAO,iBAAiB,MAAM;IAC5B,SAAS,MAPU,QAAQ,wBAAwB;KACnD,0BAA0B;KAC1B;KACW;KACZ,CAAC;IAIA,SAAS,YAAY,MAAM;IAC5B,CAAC;;EAEL,CAAC;;;;AC3CJ,MAAa,4BAA4B,EAAE,OAAO;CAChD,OAAO,EAAE,QAAQ;CACjB,eAAe,EAAE,SAAS;CAC3B,CAAC;AAGF,MAAa,uBAAuB,EAAE,OAAO;CAC3C,wBAAwB,EAAE,QAAQ,CAAC,SAAS,0CAA0C;CAC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,WAAW,EAAE,CAAC,EACd,wBAAwB,MAAM;AAChD,MAAI,CAAC,KACH,OAAM,IAAI,MAAM,+BAA+B,WAAW,YAAY;AAExE,SAAO"}
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Assessment, AssessmentCreateInput, AssessmentGroup, AssessmentQuestionInput, AssessmentSubmitForReviewInput, AssessmentTemplate, AssessmentTemplateCreateInput, AssessmentTemplateExport, AssessmentUpdateInput, ListOptions, PaginatedResponse, ToolClients, ToolDefinition, TranscendGraphQLBase, z } from "@transcend-io/mcp-server-base";
2
- import * as _transcend_io_privacy_types0 from "@transcend-io/privacy-types";
2
+ import * as _$_transcend_io_privacy_types0 from "@transcend-io/privacy-types";
3
3
  import { AssessmentFormStatus, AssessmentFormTemplateStatus } from "@transcend-io/privacy-types";
4
4
 
5
5
  //#region src/tools/index.d.ts
@@ -217,7 +217,7 @@ declare const UpdateAssessmentSchema: z.ZodObject<{
217
217
  description: z.ZodOptional<z.ZodString>;
218
218
  reviewer_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
219
219
  due_date: z.ZodOptional<z.ZodString>;
220
- status: z.ZodOptional<z.ZodEnum<typeof _transcend_io_privacy_types0.AssessmentFormStatus>>;
220
+ status: z.ZodOptional<z.ZodEnum<typeof _$_transcend_io_privacy_types0.AssessmentFormStatus>>;
221
221
  }, z.core.$strip>;
222
222
  type UpdateAssessmentInput = z.infer<typeof UpdateAssessmentSchema>;
223
223
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transcend-io/mcp-server-assessment",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "description": "Transcend MCP Server — Assessments tools.",
5
5
  "homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-assessment",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  "@modelcontextprotocol/sdk": "^1.29.0",
34
34
  "zod": "^4.3.6",
35
35
  "@transcend-io/mcp-server-base": "0.4.5",
36
- "@transcend-io/privacy-types": "5.2.4"
36
+ "@transcend-io/privacy-types": "5.2.5"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@arethetypeswrong/cli": "^0.18.2",