@burdenoff/mcp-libs 2026.1111.2 → 2026.1115.1

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":"index.js","names":["WORKFLOW_FIELDS","RUN_FIELDS","text","ops.LIST_WORKFLOW_VARIABLES","ops.GET_WORKFLOW_VARIABLE","ops.CREATE_WORKFLOW_VARIABLE","ops.UPDATE_WORKFLOW_VARIABLE","ops.DELETE_WORKFLOW_VARIABLE","ops.LIST_DATA_TABLES","ops.GET_DATA_TABLE","ops.QUERY_DATA_TABLE_ROWS","ops.GET_WORKFLOW_STATIC_DATA","ops.LIST_WORKFLOW_STATIC_DATA","ops.PIN_NODE_DATA","ops.UNPIN_NODE_DATA","text","ops.GET_WORKFLOW_SUMMARY","ops.DIFF_WORKFLOW_VERSIONS","ops.RESTORE_WORKFLOW_VERSION","ops.GET_RUN_HIERARCHY","ops.LIST_NODE_STATES","ops.GET_NODE_STATE","ops.CAN_RUN_FROM_NODE","ops.LIST_CUSTOM_NODES","ops.GET_NODE_MANIFEST","ops.GET_NODE_USAGE_STATUS","ops.LIST_OPERATION_CONFIGS","ops.GET_OPERATION_CONFIG","ops.LIST_NODE_INSTALLATIONS","ops.LIST_WEBHOOK_DELIVERIES","ops.LIST_ALL_WEBHOOK_DELIVERIES","ops.LIST_WEBHOOK_EVENT_FILTERS","ops.GET_SCHEDULER_STATUS","ops.RESTORE_SCHEDULED_JOB","ops.GET_ERROR_ANALYTICS","ops.GET_USAGE_TIME_SERIES","ops.GET_DETAILED_NODE_USAGE","ops.GET_BILLING_SUMMARY","ops.LIST_PENDING_TOOL_APPROVALS","ops.GET_TOOL_APPROVAL_REQUEST","ops.LIST_LOG_STREAM_DESTINATIONS","ops.GET_LOG_STREAM_DESTINATION","ops.LIST_SECRETS_PROVIDER_CONFIGS","ops.RUN_BY_WORKFLOW_ID","ops.DESCRIBE_RUN","ops.RUN_PENDING","ops.RUN_PENDING_BY_WORKFLOW_ID","ops.RUNS_COUNT","ops.RUN_HISTORY","ops.RUN_HISTORY_BY_TARGET","ops.SIGNAL_RUN","ops.SIGNAL_RUN_BY_TARGET","ops.RUN_STACK_TRACE_PARITY","ops.RUN_STACK_TRACE","ops.RUN_DETERMINISM_STATUS","ops.TERMINATE_RUN","ops.TERMINATE_RUN_BY_TARGET","ops.START_WORKFLOW_TERMINATE_EXISTING","ops.START_WORKFLOW_PARITY","ops.START_WORKFLOW","ops.EXPORT_WORKFLOW","ops.WORKFLOW_INTERFACE","ops.VALIDATE_WORKFLOW_DEFINITION","ops.CREATE_WORKFLOW_VERSION","ops.IMPORT_WORKFLOW","ops.IMPORT_WORKFLOW_TEMPLATE"],"sources":["../../../src/modules/fluidgrids/durable-operations.ts","../../../src/modules/fluidgrids/extended-operations.ts","../../../src/modules/fluidgrids/operations.ts","../../../src/modules/fluidgrids/tools/helpers.ts","../../../src/modules/fluidgrids/tools/credentials.ts","../../../src/modules/fluidgrids/tools/data.ts","../../../src/modules/fluidgrids/tools/insights.ts","../../../src/modules/fluidgrids/tools/inspect.ts","../../../src/modules/fluidgrids/tools/nodes.ts","../../../src/modules/fluidgrids/tools/runs.ts","../../../src/modules/fluidgrids/tools/durable.ts","../../../src/modules/fluidgrids/tools/scheduled-jobs.ts","../../../src/modules/fluidgrids/tools/webhooks.ts","../../../src/modules/fluidgrids/tools/workflows.ts","../../../src/modules/fluidgrids/prompts.ts","../../../src/modules/fluidgrids/resources.ts","../../../src/modules/fluidgrids/index.ts"],"sourcesContent":["/** Code-first and durable-run documents, matching sdk-libs-node's FluidGrids contract. */\nconst WORKFLOW_FIELDS = `id workflowKey name description version status category tags icon isActive totalVersions createdAt updatedAt`;\nconst RUN_FIELDS = `\n id workflowId workflowKey version status startedAt completedAt duration errorMessage\n executionKind workflowFn taskQueue buildId historyLength parentClosePolicy cancelRequestedAt\n determinism { failing cause attempts since lastFailureSeq message }\n`;\nconst PARITY_FIELDS = `${RUN_FIELDS}\n businessId runAttempt firstRunId continuedFromRunId continuedToRunId priority\n summary details currentDetails memo startDelayUntil runTimeoutAt executionTimeoutAt\n`;\nconst PENDING_FIELDS = `\n activities { activityId activityType state attempt maxAttempts scheduledAt lastStartedAt\n lastHeartbeatAt heartbeatDetails lastFailure nextAttemptAt summary }\n children { runId workflowKey version status startedAt }\n timers { timerId fireAt summary }\n bufferedSignals workflowTask { state attempt startedAt failureCause }\n`;\n\nexport const EXPORT_WORKFLOW = `\n query FluidgridsExportWorkflow($workflowKey: String!, $version: String, $format: WorkflowExportFormat, $options: ExportOptionsInput) {\n exportWorkflow(workflowKey: $workflowKey, version: $version, format: $format, options: $options) {\n format schemaVersion exportedAt workflowKey version name description definitionJson context tags icon category\n nodeReferences { nodeId nodeType nodeVersion }\n exportFormat files { path contentType content url }\n fidelity { level items { nodeId path kind detail } } irHash\n }\n }\n`;\nexport const IMPORT_WORKFLOW = `\n mutation FluidgridsImportWorkflow($input: ImportWorkflowInput!) {\n importWorkflow(input: $input) {\n success message workflow { ${WORKFLOW_FIELDS} }\n validation { valid errors warnings missingNodes { nodeId nodeType nodeVersion } }\n }\n }\n`;\nexport const IMPORT_WORKFLOW_TEMPLATE = `\n mutation FluidgridsImportWorkflowTemplate($input: ImportWorkflowTemplateInput!) {\n importWorkflowTemplate(input: $input) { success message workflow { ${WORKFLOW_FIELDS} } }\n }\n`;\nexport const CREATE_WORKFLOW_VERSION = `\n mutation FluidgridsCreateWorkflowVersion($workflowKey: String!, $input: CreateWorkflowVersionInput!) {\n createWorkflowVersion(workflowKey: $workflowKey, input: $input) {\n success message workflow { ${WORKFLOW_FIELDS} }\n }\n }\n`;\nexport const VALIDATE_WORKFLOW_DEFINITION = `\n query FluidgridsValidateWorkflowDefinition($definitionJson: JSON!, $strict: Boolean) {\n validateWorkflowDefinition(definitionJson: $definitionJson, strict: $strict) {\n valid errors { code message nodeId path } warnings { code message nodeId path }\n schemaVersion irHash taskQueues\n }\n }\n`;\nexport const WORKFLOW_INTERFACE = `\n query FluidgridsWorkflowInterface($workflowKey: String!, $version: String) {\n workflowInterface(workflowKey: $workflowKey, version: $version)\n }\n`;\nexport const START_WORKFLOW = `\n mutation FluidgridsStartWorkflow($input: StartWorkflowInput!) {\n startWorkflow(input: $input) { run { ${RUN_FIELDS} } existing }\n }\n`;\nexport const START_WORKFLOW_PARITY = `\n mutation FluidgridsStartWorkflowParity($input: StartWorkflowInput!) {\n startWorkflow(input: $input) { run { ${PARITY_FIELDS} } existing }\n }\n`;\nexport const START_WORKFLOW_TERMINATE_EXISTING = `\n mutation FluidgridsStartWorkflowTerminateExisting($input: StartWorkflowInput!) {\n startWorkflowTerminateExisting(input: $input) { run { ${PARITY_FIELDS} } existing }\n }\n`;\nexport const DESCRIBE_RUN = `\n query FluidgridsDescribeRun($id: ID!) { workflowRun(id: $id) { ${RUN_FIELDS} } }\n`;\nexport const RUN_BY_WORKFLOW_ID = `\n query FluidgridsRunByWorkflowId($workflowKey: String!, $workflowId: String!, $firstRunId: ID) {\n workflowRunByWorkflowId(workflowKey: $workflowKey, workflowId: $workflowId, firstRunId: $firstRunId) { ${PARITY_FIELDS} }\n }\n`;\nexport const RUN_PENDING = `\n query FluidgridsRunPending($id: ID!) { workflowRun(id: $id) { id status pending { ${PENDING_FIELDS} } } }\n`;\nexport const RUN_PENDING_BY_WORKFLOW_ID = `\n query FluidgridsRunPendingByWorkflowId($workflowKey: String!, $workflowId: String!, $firstRunId: ID) {\n workflowRunByWorkflowId(workflowKey: $workflowKey, workflowId: $workflowId, firstRunId: $firstRunId) { id status pending { ${PENDING_FIELDS} } }\n }\n`;\nexport const RUNS_COUNT = `\n query FluidgridsRunsCount($filter: ListWorkflowRunsInput, $groupBy: [RunGroupBy!]) {\n workflowRunsCount(filter: $filter, groupBy: $groupBy) { total groups { key values count } groupsTruncated }\n }\n`;\nconst HISTORY_FIELDS = `events { runId seq type taskId payload payloadUrl createdAt } nextAfter hasMore historyLength historyBytes`;\nexport const RUN_HISTORY = `\n query FluidgridsRunHistory($runId: ID!, $after: Int, $limit: Int) {\n workflowRunHistory(runId: $runId, after: $after, limit: $limit) { ${HISTORY_FIELDS} }\n }\n`;\nexport const RUN_HISTORY_BY_TARGET = `\n query FluidgridsRunHistoryByTarget($target: RunTargetInput!, $after: Int, $limit: Int) {\n workflowRunHistory(target: $target, after: $after, limit: $limit) { ${HISTORY_FIELDS} }\n }\n`;\nconst SIGNAL_FIELDS = `accepted delivered buffered forwardedToRunId seq duplicate`;\nexport const SIGNAL_RUN = `\n mutation FluidgridsSignalRun($runId: ID!, $name: String!, $payload: JSON, $idempotencyKey: String) {\n signalWorkflowRun(runId: $runId, name: $name, payload: $payload, idempotencyKey: $idempotencyKey) { ${SIGNAL_FIELDS} }\n }\n`;\nexport const SIGNAL_RUN_BY_TARGET = `\n mutation FluidgridsSignalRunByTarget($target: RunTargetInput!, $name: String!, $payload: JSON, $idempotencyKey: String) {\n signalWorkflowRun(target: $target, name: $name, payload: $payload, idempotencyKey: $idempotencyKey) { ${SIGNAL_FIELDS} }\n }\n`;\nexport const RUN_STACK_TRACE = `\n query FluidgridsRunStackTrace($runId: ID!, $enhanced: Boolean) {\n workflowRunStackTrace(runId: $runId, enhanced: $enhanced) { trace enhanced }\n }\n`;\nexport const RUN_STACK_TRACE_PARITY = `\n query FluidgridsRunStackTraceParity($runId: ID, $target: RunTargetInput, $enhanced: Boolean, $metadata: Boolean) {\n workflowRunStackTrace(runId: $runId, target: $target, enhanced: $enhanced, metadata: $metadata) {\n trace enhanced metadata { definition currentDetails }\n }\n }\n`;\nexport const RUN_DETERMINISM_STATUS = `\n query FluidgridsRunDeterminismStatus($runId: ID!) {\n workflowRunDeterminismStatus(runId: $runId) { failing cause attempts since lastFailureSeq message }\n }\n`;\nexport const TERMINATE_RUN = `\n mutation FluidgridsTerminateRun($runId: ID!, $reason: String) {\n terminateWorkflowRun(runId: $runId, reason: $reason) { id status completedAt errorMessage }\n }\n`;\nexport const TERMINATE_RUN_BY_TARGET = `\n mutation FluidgridsTerminateRunByTarget($target: RunTargetInput!, $reason: String) {\n terminateWorkflowRun(target: $target, reason: $reason) { id status completedAt errorMessage }\n }\n`;\n","/**\n * FluidGrids documents for the operations sdk-libs-node added in its\n * 2026-11-02 wave that the MCP exposes (BOFF-10887): run inspection, workflow\n * version summaries, the node catalog, insights, webhook deliveries, tool\n * approvals, log streams, secrets providers, variables, data tables, static\n * data and pinned data.\n *\n * Every document is copied from sdk-libs-node `src/modules/fluidgrids/operations.ts`\n * with the same operation name, so a document here and its SDK twin stay easy to\n * compare. The SDK validates them against the production supergraph every night\n * (Operation Conformance); tests/unit/platform-supergraph-contract.test.ts\n * validates them here. All of them are workspace tier.\n *\n * The SDK operations the MCP does not expose (and why) are listed in\n * .parity-allowlist.yaml.\n */\n\nconst WORKFLOW_FIELDS = `\n id workflowKey name description version status category tags icon isActive\n totalVersions projectId createdAt updatedAt\n`;\n\nconst RUN_FIELDS = `\n id workflowId workflowKey version status mode startedAt completedAt duration\n triggeredById triggerNodeId errorMessage errorType progress totalNodes\n completedNodes failedNodes skippedNodes createdAt\n`;\n\nconst NODE_STATE_FIELDS = `\n id nodeId nodeType nodeVersion status error errorType attemptCount startTime endTime duration\n output\n`;\n\nconst NODE_STATE_DETAIL_FIELDS = `\n ${NODE_STATE_FIELDS} runId inputArgs instanceKey childRunId resumeTime reusedFromRunId\n usedPinnedData\n`;\n\n/** One run in the sub-workflow tree: where it sits and which node of its parent started it. */\nconst RUN_HIERARCHY_NODE_FIELDS = `depth parentNodeId run { ${RUN_FIELDS} }`;\n\n/**\n * A document cannot recurse, so six levels of sub-workflow runs are spelled\n * out: depth 9 of the gateways' 10. A run nested deeper is cut off.\n */\nconst RUN_HIERARCHY_CHILDREN = `\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS} }\n }\n }\n }\n }\n }\n`;\n\nconst NODE_FIELDS = `\n id nodeType nodeVersion name description category icon logo keywords kind author\n publishType status isLatest endpointUrl operations supportsAdapterMode\n adapterOutputType docsUrl createdAt updatedAt\n`;\n\nconst OPERATION_CONFIG_FIELDS = `id nodeType nodeVersion operationName config createdAt updatedAt`;\n\nconst NODE_INSTALLATION_FIELDS = `\n id workspaceId nodeType nodeVersion publishType isEnabled config enabledAt enabledById\n disabledAt updatedAt\n`;\n\n/**\n * One request that reached a webhook's URL. The backend masks credentials in\n * `requestHeaders` as `[REDACTED]`; the body is what the sender sent.\n */\nconst WEBHOOK_DELIVERY_FIELDS = `\n id eventRegistrationId requestHeaders requestBody requestIp validationPassed validationError\n workflowRunId executionStarted executionError responseStatus responseBody receivedAt\n processedAt duration\n`;\n\nconst SCHEDULED_JOB_FIELDS = `\n id name workflowKey version schedule enabled nextRun lastRun config workspaceId createdAt\n updatedAt\n`;\n\nconst TOOL_APPROVAL_REQUEST_FIELDS = `\n id runId nodeId workflowId workflowKey workspaceId status\n toolCalls { callId name argsJson }\n decisions { callId decision reason }\n timeoutAt timeoutAction requestedAt decidedAt decidedBy createdAt updatedAt\n`;\n\n/** `hasSecret` says whether a secret is stored; the secret itself is never returned. */\nconst LOG_STREAM_DESTINATION_FIELDS = `\n id workspaceId name provider endpoint config hasSecret eventFilters isEnabled lastDispatchedAt\n lastDispatchStatus lastDispatchError createdAt updatedAt createdBy updatedBy\n`;\n\n/** Where an external secret store lives; no credential is part of the type. */\nconst SECRETS_PROVIDER_CONFIG_FIELDS = `\n id workspaceId provider awsRegion awsSecretsManagerPrefix azureKeyVaultUri gcpProjectId\n vaultAddress vaultMountPath isEnabled lastTestStatus lastTestMessage lastTestedAt createdAt\n updatedAt\n`;\n\nconst WORKFLOW_STATIC_DATA_FIELDS = `\n id workflowKey scope nodeId data sizeBytes version workspaceId createdAt updatedAt\n`;\n\n/** `value` is null for a secret or externally backed variable. */\nconst WORKFLOW_VARIABLE_FIELDS = `\n id key scope projectId workspaceId description isSecret value externalProvider externalRef\n createdAt createdBy updatedAt updatedBy\n`;\n\nconst DATA_TABLE_FIELDS = `\n id workspaceId name description\n columns { key label type required defaultValue }\n rowCount sizeBytes createdAt createdBy updatedAt updatedBy\n`;\n\nconst DATA_TABLE_ROW_FIELDS = `id tableId data createdAt updatedAt`;\n\nconst PINNED_WORKFLOW_FIELDS = `${WORKFLOW_FIELDS} pinnedNodeData`;\n\n// --- Workflows -----------------------------------------------------------------\n\nexport const GET_WORKFLOW_SUMMARY = `\n query FluidgridsGetWorkflowSummary($workflowKey: String!) {\n workflowSummary(workflowKey: $workflowKey) {\n workflowKey\n totalVersions\n latestVersion\n createdAt\n lastModified\n }\n }\n`;\n\nexport const DIFF_WORKFLOW_VERSIONS = `\n query FluidgridsDiffWorkflowVersions(\n $workflowKey: String!\n $fromVersion: String!\n $toVersion: String!\n ) {\n workflowVersionDiff(\n workflowKey: $workflowKey\n fromVersion: $fromVersion\n toVersion: $toVersion\n ) {\n workflowKey\n fromVersion\n toVersion\n truncated\n entries { path kind before after }\n }\n }\n`;\n\n/** A new DRAFT copied from an old version; the old one is untouched. */\nexport const RESTORE_WORKFLOW_VERSION = `\n mutation FluidgridsRestoreWorkflowVersion($workflowKey: String!, $version: String!) {\n restoreWorkflowVersion(workflowKey: $workflowKey, version: $version) {\n success\n message\n workflow { ${WORKFLOW_FIELDS} }\n }\n }\n`;\n\n// --- Runs ----------------------------------------------------------------------\n\nexport const GET_RUN_HIERARCHY = `\n query FluidgridsGetRunHierarchy($runId: ID!) {\n workflowRunHierarchy(runId: $runId) {\n totalDepth\n root { ${RUN_FIELDS} }\n ${RUN_HIERARCHY_CHILDREN}\n }\n }\n`;\n\nexport const LIST_NODE_STATES = `\n query FluidgridsListNodeStates($runId: String!) {\n nodeStates(runId: $runId) { ${NODE_STATE_FIELDS} }\n }\n`;\n\nexport const GET_NODE_STATE = `\n query FluidgridsGetNodeState($id: ID!) {\n nodeState(id: $id) { ${NODE_STATE_DETAIL_FIELDS} }\n }\n`;\n\n/** The backend's read-only preflight for a run from a node. */\nexport const CAN_RUN_FROM_NODE = `\n query FluidgridsCanRunFromNode($input: RunFromNodeEligibilityInput!) {\n runFromNodeEligibility(input: $input) {\n eligible\n reason\n sourceRunId\n workflowKey\n version\n targetNodeId\n targetStatus\n sourceMode\n ancestorNodeIds\n completedAncestorNodeIds\n blockedNodeIds\n blockers\n }\n }\n`;\n\n// --- Nodes ---------------------------------------------------------------------\n\nexport const LIST_CUSTOM_NODES = `\n query FluidgridsListCustomNodes($pagination: WorkflowPaginationInput) {\n customNodes(pagination: $pagination) {\n items { ${NODE_FIELDS} }\n pagination { page limit total totalPages hasNext hasPrev }\n }\n }\n`;\n\n/** A JSON object assembled from the registry's record; null when there is no such node. */\nexport const GET_NODE_MANIFEST = `\n query FluidgridsGetNodeManifest($nodeType: String!, $version: String!) {\n nodeManifest(nodeType: $nodeType, version: $version)\n }\n`;\n\nexport const GET_NODE_USAGE_STATUS = `\n query FluidgridsGetNodeUsageStatus($nodeType: String!, $nodeVersion: String!) {\n nodeUsageStatus(nodeType: $nodeType, nodeVersion: $nodeVersion) {\n nodeType\n nodeVersion\n isInUse\n workflowCount\n workflows { workflowId workflowKey workflowName }\n }\n }\n`;\n\nexport const LIST_OPERATION_CONFIGS = `\n query FluidgridsListOperationConfigs(\n $nodeType: String\n $nodeVersion: String\n $pagination: WorkflowPaginationInput\n ) {\n operationConfigs(nodeType: $nodeType, nodeVersion: $nodeVersion, pagination: $pagination) {\n configs { ${OPERATION_CONFIG_FIELDS} }\n pagination { total limit offset hasMore }\n }\n }\n`;\n\nexport const GET_OPERATION_CONFIG = `\n query FluidgridsGetOperationConfig(\n $nodeType: String!\n $nodeVersion: String!\n $operationName: String!\n ) {\n operationConfig(nodeType: $nodeType, nodeVersion: $nodeVersion, operationName: $operationName) {\n ${OPERATION_CONFIG_FIELDS}\n }\n }\n`;\n\nexport const LIST_NODE_INSTALLATIONS = `\n query FluidgridsListNodeInstallations {\n workspaceNodeInstallations { ${NODE_INSTALLATION_FIELDS} }\n }\n`;\n\n// --- Webhooks ------------------------------------------------------------------\n\nexport const LIST_WEBHOOK_DELIVERIES = `\n query FluidgridsListWebhookDeliveries($eventRegistrationId: String!, $limit: Int) {\n webhookDeliveryLogs(eventRegistrationId: $eventRegistrationId, limit: $limit) {\n ${WEBHOOK_DELIVERY_FIELDS}\n }\n }\n`;\n\nexport const LIST_ALL_WEBHOOK_DELIVERIES = `\n query FluidgridsListAllWebhookDeliveries($limit: Int, $offset: Int, $validationPassed: Boolean) {\n allWebhookDeliveries(limit: $limit, offset: $offset, validationPassed: $validationPassed) {\n ${WEBHOOK_DELIVERY_FIELDS}\n }\n }\n`;\n\nexport const LIST_WEBHOOK_EVENT_FILTERS = `\n query FluidgridsListWebhookEventFilters($eventRegistrationId: String!) {\n eventFilters(eventRegistrationId: $eventRegistrationId) {\n id\n eventRegistrationId\n filterType\n filterExpression\n isActive\n createdAt\n updatedAt\n }\n }\n`;\n\n// --- Scheduled jobs ------------------------------------------------------------\n\nexport const RESTORE_SCHEDULED_JOB = `\n mutation FluidgridsRestoreScheduledJob($jobId: ID!) {\n restoreScheduledJob(jobId: $jobId) {\n success\n message\n job { ${SCHEDULED_JOB_FIELDS} }\n }\n }\n`;\n\nexport const GET_SCHEDULER_STATUS = `\n query FluidgridsGetSchedulerStatus {\n workflowScheduledJobsStatus\n }\n`;\n\n// --- Insights ------------------------------------------------------------------\n\nexport const GET_ERROR_ANALYTICS = `\n query FluidgridsGetErrorAnalytics($input: ErrorAnalyticsInput) {\n errorAnalytics(input: $input) {\n totalErrors\n errorsByType { errorType count }\n topFailingWorkflows { workflowKey name totalRuns failureCount failureRate }\n topFailingNodes { nodeType totalExecutions failureCount failureRate sampleError }\n trend { date count }\n }\n }\n`;\n\nexport const GET_USAGE_TIME_SERIES = `\n query FluidgridsGetUsageTimeSeries($input: TimeSeriesInput!) {\n usageTimeSeries(input: $input) {\n metric\n granularity\n dataPoints {\n timestamp\n workflowRuns\n successfulRuns\n failedRuns\n cancelledRuns\n nodeExecutions\n averageDuration\n totalDuration\n }\n }\n }\n`;\n\nexport const GET_DETAILED_NODE_USAGE = `\n query FluidgridsGetDetailedNodeUsage($input: DetailedNodeUsageInput!) {\n detailedNodeUsage(input: $input) {\n nodeType\n nodeVersion\n executionCount\n successCount\n failureCount\n skipCount\n totalDuration\n averageDuration\n medianDuration\n minDuration\n maxDuration\n successRate\n lastExecutedAt\n }\n }\n`;\n\nexport const GET_BILLING_SUMMARY = `\n query FluidgridsGetBillingSummary($input: BillingSummaryInput!) {\n billingSummary(input: $input) {\n period\n totalWorkflowRuns\n totalNodeExecutions\n totalDurationSeconds\n nodeMinutes\n estimatedCost\n breakdown\n }\n }\n`;\n\n// --- Tool approvals ------------------------------------------------------------\n\nexport const LIST_PENDING_TOOL_APPROVALS = `\n query FluidgridsListPendingToolApprovals($limit: Int, $offset: Int) {\n pendingToolApprovals(limit: $limit, offset: $offset) {\n totalCount\n items { ${TOOL_APPROVAL_REQUEST_FIELDS} }\n }\n }\n`;\n\nexport const GET_TOOL_APPROVAL_REQUEST = `\n query FluidgridsGetToolApprovalRequest($id: ID!) {\n toolApprovalRequest(id: $id) { ${TOOL_APPROVAL_REQUEST_FIELDS} }\n }\n`;\n\n// --- Log streams and secrets providers -----------------------------------------\n\nexport const LIST_LOG_STREAM_DESTINATIONS = `\n query FluidgridsListLogStreamDestinations {\n logStreamDestinations { ${LOG_STREAM_DESTINATION_FIELDS} }\n }\n`;\n\nexport const GET_LOG_STREAM_DESTINATION = `\n query FluidgridsGetLogStreamDestination($id: ID!) {\n logStreamDestination(id: $id) { ${LOG_STREAM_DESTINATION_FIELDS} }\n }\n`;\n\nexport const LIST_SECRETS_PROVIDER_CONFIGS = `\n query FluidgridsListSecretsProviderConfigs {\n secretsProviderConfigs { ${SECRETS_PROVIDER_CONFIG_FIELDS} }\n }\n`;\n\n// --- Variables -----------------------------------------------------------------\n\nexport const LIST_WORKFLOW_VARIABLES = `\n query FluidgridsListWorkflowVariables($projectId: ID, $scope: VariableScope) {\n workflowVariables(projectId: $projectId, scope: $scope) {\n total\n variables { ${WORKFLOW_VARIABLE_FIELDS} }\n }\n }\n`;\n\nexport const GET_WORKFLOW_VARIABLE = `\n query FluidgridsGetWorkflowVariable($id: ID!) {\n workflowVariable(id: $id) { ${WORKFLOW_VARIABLE_FIELDS} }\n }\n`;\n\nexport const CREATE_WORKFLOW_VARIABLE = `\n mutation FluidgridsCreateWorkflowVariable($input: CreateWorkflowVariableInput!) {\n createWorkflowVariable(input: $input) {\n success\n message\n variable { ${WORKFLOW_VARIABLE_FIELDS} }\n }\n }\n`;\n\nexport const UPDATE_WORKFLOW_VARIABLE = `\n mutation FluidgridsUpdateWorkflowVariable($id: ID!, $input: UpdateWorkflowVariableInput!) {\n updateWorkflowVariable(id: $id, input: $input) {\n success\n message\n variable { ${WORKFLOW_VARIABLE_FIELDS} }\n }\n }\n`;\n\nexport const DELETE_WORKFLOW_VARIABLE = `\n mutation FluidgridsDeleteWorkflowVariable($id: ID!) {\n deleteWorkflowVariable(id: $id) {\n success\n message\n }\n }\n`;\n\n// --- Data tables ---------------------------------------------------------------\n\nexport const LIST_DATA_TABLES = `\n query FluidgridsListDataTables($search: String, $limit: Int, $offset: Int) {\n dataTables(search: $search, limit: $limit, offset: $offset) {\n total\n tables { ${DATA_TABLE_FIELDS} }\n }\n }\n`;\n\nexport const GET_DATA_TABLE = `\n query FluidgridsGetDataTable($id: ID!) {\n dataTable(id: $id) { ${DATA_TABLE_FIELDS} }\n }\n`;\n\nexport const QUERY_DATA_TABLE_ROWS = `\n query FluidgridsQueryDataTableRows($input: DataTableRowsQueryInput!) {\n dataTableRows(input: $input) {\n total\n rows { ${DATA_TABLE_ROW_FIELDS} }\n }\n }\n`;\n\n// --- Static data ---------------------------------------------------------------\n\nexport const GET_WORKFLOW_STATIC_DATA = `\n query FluidgridsGetWorkflowStaticData(\n $workflowKey: String!\n $scope: StaticDataScope!\n $nodeId: String\n ) {\n workflowStaticData(workflowKey: $workflowKey, scope: $scope, nodeId: $nodeId) {\n ${WORKFLOW_STATIC_DATA_FIELDS}\n }\n }\n`;\n\nexport const LIST_WORKFLOW_STATIC_DATA = `\n query FluidgridsListWorkflowStaticData($workflowKey: String!) {\n workflowStaticDataList(workflowKey: $workflowKey) { ${WORKFLOW_STATIC_DATA_FIELDS} }\n }\n`;\n\n// --- Pinned data ---------------------------------------------------------------\n\n/** Pins the output a node returns in a TEST run; a PRODUCTION run never uses it. */\nexport const PIN_NODE_DATA = `\n mutation FluidgridsPinNodeData($id: ID!, $nodeId: String!, $data: JSON!) {\n pinNodeData(id: $id, nodeId: $nodeId, data: $data) { ${PINNED_WORKFLOW_FIELDS} }\n }\n`;\n\nexport const UNPIN_NODE_DATA = `\n mutation FluidgridsUnpinNodeData($id: ID!, $nodeId: String!) {\n unpinNodeData(id: $id, nodeId: $nodeId) { ${PINNED_WORKFLOW_FIELDS} }\n }\n`;\n","/**\n * FluidGrids GraphQL operations (BOFF-7088).\n *\n * Ported verbatim from \\`@fluidgrids/sdk\\` (fluidgrids-sdk-node) \\`src/graphql/\\`,\n * which validates every one of these documents against vendored snapshots of the\n * deployed supergraphs in CI. Do not hand-edit a document here without making the\n * same change there -- the SDK is the source of truth and the only place the\n * documents are schema-checked.\n *\n * Every operation below is WORKSPACE tier (\\`ctx.gql.workspace\\`). Authentication,\n * \\`currentUser\\` and \\`health\\` are global tier and are already served by the\n * \\`auth\\` and \\`health\\` modules -- they are deliberately not duplicated here.\n */\n\nexport * from './durable-operations.js';\nexport * from './extended-operations.js';\n\n// Workflows\n// `Query.workflows` also exists on the workspace supergraph, but it belongs to a\n// different subgraph and returns BigConsole's `FluidGridsWorkflow` (linkedDataSinks,\n// externalWorkflowId) — a name collision, not our type. FluidGrids workflows are\n// `workflowDefinition` / `workflowDefinitions`, returning `WorkflowDefinition`.\nexport const LIST_WORKFLOWS = `\n query ListWorkflows($input: ListWorkflowDefinitionsInput!) {\n workflowDefinitions(input: $input) {\n items {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_WORKFLOW = `\n query GetWorkflow($id: ID, $workflowKey: String, $version: String) {\n workflowDefinition(id: $id, workflowKey: $workflowKey, version: $version) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n definitionJson\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey, not workflowId, and returns a plain array.\nexport const GET_WORKFLOW_VERSIONS = `\n query GetWorkflowVersions($workflowKey: String!) {\n workflowVersions(workflowKey: $workflowKey) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Runs\nexport const LIST_RUNS = `\n query ListRuns($input: ListWorkflowRunsInput!) {\n workflowRuns(input: $input) {\n items {\n id\n workflowId\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n triggeredById\n errorMessage\n errorType\n progress\n totalNodes\n completedNodes\n failedNodes\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_RUN = `\n query GetRun($id: ID!) {\n workflowRun(id: $id) {\n id\n workflowId\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n triggeredById\n triggerData\n triggerNodeId\n errorMessage\n errorType\n progress\n totalNodes\n completedNodes\n failedNodes\n skippedNodes\n nodeStates {\n id\n nodeId\n nodeType\n status\n error\n output\n }\n }\n }\n`;\n\nexport const GET_RUN_LOGS = `\n query GetRunLogs(\n $runId: ID!\n $nodeId: String\n $minLevel: RunLogLevel\n $limit: Int\n $after: String\n $search: String\n $includeChildRuns: Boolean\n ) {\n workflowRunLogs(\n runId: $runId\n nodeId: $nodeId\n minLevel: $minLevel\n limit: $limit\n after: $after\n search: $search\n includeChildRuns: $includeChildRuns\n ) {\n lines {\n id\n runId\n nodeId\n level\n message\n timestamp\n data\n attempt\n phase\n stream\n truncated\n }\n hasMore\n nextCursor\n limitReached\n }\n }\n`;\n\n// Nodes\n// `nodes` is not a Query field. Node definitions are `nodeEndpointConfig(s)`, and the\n// response is { configs, pagination } — not { items, total, hasMore }.\nexport const LIST_NODES = `\n query ListNodes(\n $nodeType: String\n $publishType: PublishType\n $status: NodeConfigStatus\n $pagination: WorkflowPaginationInput\n ) {\n nodeEndpointConfigs(\n nodeType: $nodeType\n publishType: $publishType\n status: $status\n pagination: $pagination\n ) {\n configs {\n id\n nodeType\n nodeVersion\n name\n description\n category\n icon\n logo\n keywords\n kind\n author\n publishType\n status\n isLatest\n endpointUrl\n operations\n supportsAdapterMode\n adapterOutputType\n createdAt\n updatedAt\n }\n pagination {\n total\n limit\n offset\n hasMore\n }\n }\n }\n`;\n\n// Keyed by nodeType + nodeVersion, NOT by id.\nexport const GET_NODE = `\n query GetNode($nodeType: String!, $nodeVersion: String!) {\n nodeEndpointConfig(nodeType: $nodeType, nodeVersion: $nodeVersion) {\n id\n nodeType\n nodeVersion\n name\n description\n category\n icon\n logo\n keywords\n kind\n author\n publishType\n status\n isLatest\n endpointUrl\n operations\n supportsAdapterMode\n adapterOutputType\n createdAt\n updatedAt\n healthCheckUrl\n nodeAdapters\n }\n }\n`;\n\n// LIST_NODE_CATEGORIES removed: `nodeCategories` exists on neither supergraph and has\n// no equivalent. Categories are a field on NodeEndpointConfig; derive them client-side.\n// Credentials\n// In FluidGrids a \"credential\" is a CONNECTION (wspace-integrations-svc), and the\n// catalogue of what kinds you can create are PROVIDERS. There is no `credentials`\n// field on either supergraph.\n//\n// ★ getConnection/createConnection/updateConnection/deleteConnection/testConnection\n// ALSO exist on the GLOBAL tier, returning ChannelConnection — a different product,\n// with colliding input type names and different fields. These documents are pinned to\n// the workspace tier, which is the SDK's default endpoint. Do not \"fix\" a failure here\n// by pointing at global; it would parse, execute, and return the wrong product's data.\nexport const LIST_CREDENTIALS = `\n query ListCredentials($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {\n getConnections(filter: $filter, pagination: $pagination) {\n items {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n category\n authType\n icon\n }\n credentialSource\n externalAccountId\n externalAccountName\n externalAccountEmail\n grantedScopes\n lastUsedAt\n lastHealthCheck\n errorMessage\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_CREDENTIAL = `\n query GetCredential($id: ID!) {\n getConnection(id: $id) {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n description\n category\n authType\n configSchema\n availableScopes\n defaultScopes\n icon\n docsUrl\n }\n config\n metadata\n credentialSource\n externalAccountId\n externalAccountName\n externalAccountEmail\n grantedScopes\n lastUsedAt\n lastHealthCheck\n errorMessage\n workspaceId\n createdAt\n updatedAt\n }\n }\n`;\n\n// Returns a PAGE (ProviderList), not an array — the catalogue defaults to limit 50.\nexport const LIST_CREDENTIAL_TYPES = `\n query ListCredentialTypes($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {\n getProviders(filter: $filter, pagination: $pagination) {\n items {\n id\n key\n name\n description\n category\n authType\n configSchema\n availableScopes\n defaultScopes\n icon\n docsUrl\n isBuiltIn\n isEnabled\n connectionCount\n }\n total\n hasMore\n }\n }\n`;\n\n// Webhooks\n// A FluidGrids webhook is an EVENT REGISTRATION — it binds a workflowKey and a\n// triggerNodeId to a webhookUrl/webhookToken.\n//\n// ★ Query.webhooks ALSO exists and returns type Webhook, but that is a different\n// subgraph's OUTBOUND delivery system (agentIds, retryPolicy, deliveryCount, and a\n// neighbouring webhookExecutions taking CalendarPaginationInput). It has no\n// workflowKey and is not ours. Do not \"fix\" a failure here by switching to it.\nexport const LIST_WEBHOOKS = `\n query ListWebhooks($status: EventStatus, $workflowKey: String) {\n eventRegistrations(status: $status, workflowKey: $workflowKey) {\n id\n name\n description\n workflowKey\n triggerNodeId\n eventSource\n eventType\n status\n isActive\n webhookUrl\n webhookToken\n validationMethod\n signatureHeader\n apiKeyHeader\n payloadMapping\n config\n tags\n totalTriggers\n successfulTriggers\n failedTriggers\n lastTriggeredAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const GET_WEBHOOK = `\n query GetWebhook($id: ID!) {\n eventRegistration(id: $id) {\n id\n name\n description\n workflowKey\n triggerNodeId\n eventSource\n eventType\n status\n isActive\n webhookUrl\n webhookToken\n validationMethod\n signatureHeader\n apiKeyHeader\n payloadMapping\n config\n tags\n totalTriggers\n successfulTriggers\n failedTriggers\n lastTriggeredAt\n createdAt\n updatedAt\n projectId\n workspaceId\n createdById\n }\n }\n`;\n\n// Scheduled Jobs\n// ★ `scheduledJobs` also exists and returns ScheduledJob — the GENERIC platform\n// scheduler (cronExpression, executorType, circuitBreaker, rrule, businessCalendarId).\n// That is a different service. FluidGrids workflow crons are workflowScheduledJob(s),\n// whose type carries workflowKey/schedule/enabled/nextRun.\n// Note the response field is `jobs`, not `items`.\nexport const LIST_SCHEDULED_JOBS = `\n query ListScheduledJobs($enabled: Boolean, $workflowKey: String, $pagination: WorkflowPaginationInput) {\n workflowScheduledJobs(enabled: $enabled, workflowKey: $workflowKey, pagination: $pagination) {\n jobs {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n pagination {\n total\n limit\n offset\n hasMore\n }\n }\n }\n`;\n\n// Argument is `jobId`, not `id`.\nexport const GET_SCHEDULED_JOB = `\n query GetScheduledJob($jobId: ID!) {\n workflowScheduledJob(jobId: $jobId) {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n workspaceId\n }\n }\n`;\n\n// Dashboard\nexport const GET_DASHBOARD_SUMMARY = `\n query DashboardSummary($projectId: String) {\n dashboardSummary(projectId: $projectId) {\n userId\n username\n workflowsCount\n activeWorkflowsCount\n archivedWorkflowsCount\n runsCountTotal\n runsCompletedCount\n runsFailedCount\n runsCancelledCount\n runsPendingCount\n runsRunningCount\n runsWaitingCount\n runsCompletedLast24h\n runsFailedLast24h\n runsCompletedLast7d\n runsFailedLast7d\n runsCompletedLast30d\n runsFailedLast30d\n totalNodesExecutedCount\n workflowSuccessRate\n avgWorkflowExecutionTimeSeconds\n avgNodeExecutionTimeSeconds\n recentRuns {\n id\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n }\n recentWorkflows {\n workflowKey\n name\n version\n updatedAt\n }\n nodeUsageStats {\n nodeType\n totalExecutions\n successCount\n failureCount\n avgExecutionTime\n }\n }\n }\n`;\n\nexport const GET_USAGE_METRICS = `\n query GetUsageMetrics($input: UsageQueryInput!) {\n usageMetrics(input: $input) {\n period\n workflowMetrics {\n totalRuns\n successfulRuns\n failedRuns\n cancelledRuns\n totalDurationSeconds\n averageDurationSeconds\n minDurationSeconds\n maxDurationSeconds\n medianDurationSeconds\n }\n nodeMetrics {\n totalNodes\n successfulNodes\n failedNodes\n skippedNodes\n totalDurationSeconds\n averageDurationSeconds\n nodeTypeBreakdown\n }\n }\n }\n`;\n\n// Events have no FluidGrids equivalent. `Query.events(calendarId: ID!)` belongs to\n// the calendar service and returns an EventConnection of CalendarEvent. FluidGrids'\n// only event noun is EventRegistration, which `webhooks` already owns.\n// Search\nexport const SEARCH = `\n query Search($input: SearchRequestInput!) {\n search(input: $input) {\n query\n results\n entityCounts\n totalResults\n metadata\n }\n }\n`;\n\nexport const SEARCH_BY_ENTITY_TYPE = `\n query SearchByEntityType($entityType: String!, $query: String!, $filters: SearchFilterInput, $limit: Int, $offset: Int) {\n searchByEntityType(entityType: $entityType, query: $query, filters: $filters, limit: $limit, offset: $offset) {\n query\n results\n entityCounts\n totalResults\n metadata\n }\n }\n`;\n\n// Admin\nexport const GET_SYSTEM_CONFIG = `\n query GetSystemConfig {\n systemConfig {\n version\n revision\n environment\n deploymentType\n hostname\n hostIp\n }\n }\n`;\n\n// Workflows\n// ★★ createWorkflow / updateWorkflow / deleteWorkflow ALL exist and pass schema\n// validation — but they return FluidGridsWorkflow, which is BIGCONSOLE's datasink\n// type (linkedDataSinks, externalWorkflowId), not ours. The FluidGrids workflow CRUD\n// is the *WorkflowDefinition family. This is why \"the operation validates\" is not\n// sufficient evidence: the RETURN TYPE has to be ours too.\nexport const CREATE_WORKFLOW = `\n mutation CreateWorkflow($input: CreateWorkflowDefinitionInput!) {\n createWorkflowDefinition(input: $input) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const UPDATE_WORKFLOW = `\n mutation UpdateWorkflow($id: ID!, $input: UpdateWorkflowDefinitionInput!) {\n updateWorkflowDefinition(id: $id, input: $input) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey (+ optional version), not id.\nexport const DELETE_WORKFLOW = `\n mutation DeleteWorkflow($workflowKey: String!, $version: String) {\n deleteWorkflowDefinition(workflowKey: $workflowKey, version: $version)\n }\n`;\n\n// Everything moves into a single input; there is no `id` argument.\nexport const TRIGGER_WORKFLOW = `\n mutation TriggerWorkflow($input: TriggerWorkflowInput!) {\n triggerWorkflow(input: $input) {\n runId\n status\n workflowKey\n version\n triggerNodeId\n }\n }\n`;\n\n// One argument. There is no changeLog.\nexport const PUBLISH_WORKFLOW = `\n mutation PublishWorkflow($id: ID!) {\n publishWorkflow(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const ACTIVATE_WORKFLOW = `\n mutation ActivateWorkflow($id: ID!) {\n activateWorkflowDefinition(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const DEACTIVATE_WORKFLOW = `\n mutation DeactivateWorkflow($id: ID!) {\n deactivateWorkflowDefinition(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey + version, with the new identity in the input.\nexport const DUPLICATE_WORKFLOW = `\n mutation DuplicateWorkflow($workflowKey: String!, $version: String!, $input: DuplicateWorkflowInput!) {\n duplicateWorkflow(workflowKey: $workflowKey, version: $version, input: $input) {\n success\n message\n workflow {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const ARCHIVE_WORKFLOW = `\n mutation ArchiveWorkflow($id: ID!) {\n archiveWorkflow(id: $id) {\n id\n status\n }\n }\n`;\n\n// Runs\nexport const CANCEL_RUN = `\n mutation CancelRun($id: ID!) {\n cancelWorkflowRun(id: $id) {\n id\n status\n completedAt\n errorMessage\n }\n }\n`;\n\nexport const PAUSE_RUN = `\n mutation PauseRun($id: ID!) {\n pauseWorkflowRun(id: $id) {\n id\n status\n completedAt\n errorMessage\n }\n }\n`;\n\n// resumeWorkflowRun returns ResumeWorkflowResponse (success/message/run), not a run.\nexport const RESUME_RUN = `\n mutation ResumeRun($id: ID!, $payload: JSON) {\n resumeWorkflowRun(id: $id, payload: $payload) {\n success\n message\n resumedFromNodeId\n run {\n id\n status\n completedAt\n errorMessage\n }\n }\n }\n`;\n\n// The deployed resolver signature is `retryNode(id: ID!, nodeId: String!)` where `id` is the\n// NodeState id, not the run id. The tool takes a run id + workflow node id\n// from the caller, looks up the run to find the matching NodeState, and then\n// forwards the NodeState id to the mutation. The return type is a NodeState.\nexport const RETRY_RUN = `\n mutation RetryNode($id: ID!, $nodeId: String!) {\n retryNode(id: $id, nodeId: $nodeId) {\n id\n nodeId\n nodeType\n status\n error\n attemptCount\n }\n }\n`;\n\n// Credentials\n// ★ Creating a credential is a TWO-STEP flow. CreateConnectionInput has no `data`\n// and no `type` — there is no way to post raw secret material here. You create the\n// connection shell against a providerId, then attach the secret with one of the\n// authenticate* mutations below (or reference an existing vault secret at create time\n// via credentialSecretId / managedSecretName / vaultId).\nexport const CREATE_CREDENTIAL = `\n mutation CreateCredential($input: CreateConnectionInput!) {\n createConnection(input: $input) {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n authType\n }\n credentialSource\n createdAt\n }\n }\n`;\n\nexport const AUTHENTICATE_CREDENTIAL_API_KEY = `\n mutation AuthenticateCredentialApiKey($input: ApiKeyAuthInput!) {\n authenticateWithApiKey(input: $input) {\n id\n name\n status\n grantedScopes\n externalAccountName\n errorMessage\n updatedAt\n }\n }\n`;\n\nexport const AUTHENTICATE_CREDENTIAL_BASIC = `\n mutation AuthenticateCredentialBasic($input: BasicAuthInput!) {\n authenticateWithBasicAuth(input: $input) {\n id\n name\n status\n grantedScopes\n externalAccountName\n errorMessage\n updatedAt\n }\n }\n`;\n\n// UpdateConnectionInput carries only { config, description, name } — secrets are\n// never updated through this path.\nexport const UPDATE_CREDENTIAL = `\n mutation UpdateCredential($id: ID!, $input: UpdateConnectionInput!) {\n updateConnection(id: $id, input: $input) {\n id\n name\n description\n status\n config\n updatedAt\n }\n }\n`;\n\nexport const DELETE_CREDENTIAL = `\n mutation DeleteCredential($id: ID!, $deleteVaultSecret: Boolean) {\n deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)\n }\n`;\n\n// Argument is `connectionId`, not `id`.\nexport const TEST_CREDENTIAL = `\n mutation TestCredential($connectionId: ID!) {\n testConnection(connectionId: $connectionId) {\n success\n message\n latencyMs\n }\n }\n`;\n\n// Webhooks\nexport const CREATE_WEBHOOK = `\n mutation CreateWebhook($input: CreateEventRegistrationInput!) {\n createEventRegistration(input: $input) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n createdAt\n }\n }\n`;\n\n// ★ The previous UPDATE_WEBHOOK targeted `updateWebhook(id, input): Webhook!`, which\n// EXISTS and therefore passed schema validation — but returns the other subgraph's\n// Webhook, not our EventRegistration. Validation passing is not the same as being\n// correct; the return type has to be ours too. Same for the old deleteWebhook.\nexport const UPDATE_WEBHOOK = `\n mutation UpdateWebhook($id: ID!, $input: UpdateEventRegistrationInput!) {\n updateEventRegistration(id: $id, input: $input) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n }\n }\n`;\n\nexport const DELETE_WEBHOOK = `\n mutation DeleteWebhook($id: ID!) {\n deleteEventRegistration(id: $id)\n }\n`;\n\n// activate and deactivate are the SAME mutation with a flag.\nexport const TOGGLE_WEBHOOK = `\n mutation ToggleWebhook($id: ID!, $isActive: Boolean!) {\n toggleEventRegistration(id: $id, isActive: $isActive) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n }\n }\n`;\n\n// DEACTIVATE_WEBHOOK removed — see TOGGLE_WEBHOOK above.\n// Scheduled Jobs\nexport const CREATE_SCHEDULED_JOB = `\n mutation CreateScheduledJob($input: ScheduledJobInput!) {\n createWorkflowScheduledJob(input: $input) {\n success\n message\n job {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const UPDATE_SCHEDULED_JOB = `\n mutation UpdateScheduledJob($jobId: ID!, $input: WorkflowUpdateScheduledJobInput!) {\n updateWorkflowScheduledJob(jobId: $jobId, input: $input) {\n success\n message\n job {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const DELETE_SCHEDULED_JOB = `\n mutation DeleteScheduledJob($jobId: ID!) {\n deleteWorkflowScheduledJob(jobId: $jobId) {\n success\n message\n }\n }\n`;\n","/**\n * Internal helpers shared by the FluidGrids tool files.\n *\n * These keep each registration explicit (literal product-prefixed names via\n * mcpToolName, typed inputSchema, jsonResult/errorResult) while factoring out\n * the repetitive try/catch + structured-logging + input-pruning boilerplate.\n * Mirrors src/modules/headshotmarketing/tools/helpers.ts.\n *\n * Every FluidGrids operation is workspace tier, so `request` always goes to\n * `ctx.gql.workspace`. See ../operations.ts for why.\n */\n\nimport { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport {\n errorResult,\n registerTool,\n type McpContext,\n type ToolAnnotations,\n type ToolResult,\n} from '../../../core/index.js';\n\n/**\n * graphql-request's ClientError builds its `message` as\n * `<gql error>: ${JSON.stringify({ response, request })}` — and `request`\n * carries the operation's **variables**. For this module that means an API key\n * (credentials_auth_api_key) or a password (credentials_auth_basic) would land\n * in the log line and in the text returned to the MCP client.\n *\n * So never surface `error.message` from a transport error. When the error looks\n * like a ClientError, report only the GraphQL error messages from the response;\n * the request half is dropped entirely. Same defect class as BOFF-7165.\n */\nfunction isClientErrorShape(\n error: unknown,\n): error is { response?: { errors?: { message?: string }[]; status?: number } } {\n return typeof error === 'object' && error !== null && 'response' in error && 'request' in error;\n}\n\nexport function safeErrorMessage(error: unknown): string {\n if (isClientErrorShape(error)) {\n const errors = error.response?.errors;\n if (Array.isArray(errors) && errors.length > 0) {\n const joined = errors\n .map((e) => e?.message)\n .filter((m): m is string => typeof m === 'string' && m.length > 0)\n .join('; ');\n if (joined) return joined;\n }\n const status = error.response?.status;\n return status === undefined ? 'GraphQL request failed' : `GraphQL error (status ${status})`;\n }\n return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * Run a tool body, mapping any thrown error to a uniform error ToolResult and\n * logging it under the module-prefixed label. `label` is the short tool suffix\n * (e.g. 'workflows_get').\n */\nexport async function runTool(\n ctx: McpContext,\n label: string,\n run: () => Promise<ToolResult>,\n): Promise<ToolResult> {\n try {\n return await run();\n } catch (error) {\n const message = safeErrorMessage(error);\n ctx.logger.error(`fluidgrids ${label} failed`, { error: message });\n return errorResult(`Failed (${label}): ${message}`);\n }\n}\n\n/** Copy only the defined (non-undefined) entries into a fresh object. */\nexport function definedInput(obj: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== undefined) out[key] = value;\n }\n return out;\n}\n\n/**\n * Build a WorkflowPaginationInput, or undefined when the caller passed neither\n * bound. Sending `{}` would override the schema's own defaults with nulls.\n */\nexport function workflowPagination(\n limit?: number,\n offset?: number,\n): Record<string, unknown> | undefined {\n if (limit === undefined && offset === undefined) return undefined;\n return definedInput({ limit, offset });\n}\n\n// The deployed date-ranged insight resolvers (`usageMetrics`, `usageTimeSeries`,\n// `detailedNodeUsage`, `billingSummary`, `errorAnalytics`) take a DateTime and\n// reject a date-only string with a generic \"Please check the information\" error\n// (BOFF-8716). Accept the date-only form and normalise it: start of day for a\n// range start, end of day for a range end.\nconst ISO_DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nexport function normalizeDate(value: string | undefined, endOfDay: boolean): string | undefined {\n if (typeof value !== 'string' || !ISO_DATE_ONLY.test(value)) return value;\n return `${value}T${endOfDay ? '23:59:59' : '00:00:00'}Z`;\n}\n\n/** Explicit annotation sets. Every FluidGrids tool declares one (G57). */\nexport const READ_ONLY: ToolAnnotations = {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n};\n/** A reversible write that stays inside FluidGrids. */\nexport const INTERNAL_WRITE: ToolAnnotations = {\n readOnlyHint: false,\n destructiveHint: false,\n openWorldHint: false,\n};\n/** A write that deletes or overwrites something the caller cannot read back. */\nexport const DESTRUCTIVE_WRITE: ToolAnnotations = {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: false,\n};\n\ntype ToolFn = <Shape extends z.ZodRawShape>(\n name: string,\n title: string,\n description: string,\n shape: Shape,\n annotations: ToolAnnotations,\n handler: (args: z.infer<z.ZodObject<Shape>>) => Promise<ToolResult>,\n) => void;\n\n/**\n * Compact registration for tools that send one workspace document: the input\n * is parsed strictly against its zod shape before anything is sent, and every\n * failure goes through runTool (so a transport error never leaks request\n * variables). `request` sends one document and returns its `root` field, null\n * when the answer has none.\n */\nexport function fluidgridsToolkit(\n server: McpServer,\n ctx: McpContext,\n track: (name: string) => string,\n): {\n tool: ToolFn;\n request: <T = unknown>(\n document: string,\n root: string,\n variables?: Record<string, unknown>,\n ) => Promise<T | null>;\n} {\n const tool: ToolFn = (name, title, description, shape, annotations, handler) => {\n registerTool(\n server,\n ctx,\n track(name),\n { title, description, inputSchema: shape, annotations },\n async (args) => runTool(ctx, name, () => handler(z.object(shape).strict().parse(args))),\n );\n };\n\n async function request<T = unknown>(\n document: string,\n root: string,\n variables: Record<string, unknown> = {},\n ): Promise<T | null> {\n const data = await ctx.gql.workspace.request<Record<string, T | null | undefined>>(\n document,\n definedInput(variables),\n );\n return data?.[root] ?? null;\n }\n\n return { tool, request };\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n AUTHENTICATE_CREDENTIAL_API_KEY,\n AUTHENTICATE_CREDENTIAL_BASIC,\n CREATE_CREDENTIAL,\n DELETE_CREDENTIAL,\n GET_CREDENTIAL,\n LIST_CREDENTIALS,\n LIST_CREDENTIAL_TYPES,\n TEST_CREDENTIAL,\n UPDATE_CREDENTIAL,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// FluidGrids credentials are Connections against a Provider, served by the\n// integrations subgraph. There is no `credential`/`credentialType` field on the\n// deployed schema — that naming is what made the old SDK documents unexecutable.\nfunction pagination(limit?: number, offset?: number): Record<string, unknown> | undefined {\n if (limit === undefined && offset === undefined) return undefined;\n return definedInput({ limit, offset });\n}\n\nexport function registerCredentialTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_list')),\n {\n title: 'List Credentials',\n description: 'List stored connections (credentials) available to workflows.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n providerId: z.string().optional().describe('Filter by provider ID'),\n name: z.string().optional().describe('Filter by name'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ providerId, name, limit, offset }) =>\n runTool(ctx, 'credentials_list', async () => {\n const filter = definedInput({ providerId, name });\n const data = await ctx.gql.workspace.request<{ getConnections: unknown }>(\n LIST_CREDENTIALS,\n {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: pagination(limit, offset),\n },\n );\n return jsonResult(data.getConnections);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_get')),\n {\n title: 'Get Credential',\n description: 'Get one connection by ID. Secret material is never returned.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Connection ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'credentials_get', async () => {\n const data = await ctx.gql.workspace.request<{ getConnection: unknown }>(GET_CREDENTIAL, {\n id,\n });\n return jsonResult(data.getConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_list_types')),\n {\n title: 'List Credential Types',\n description: 'List the providers a connection can be created against.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n name: z.string().optional().describe('Filter by provider name'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ name, limit, offset }) =>\n runTool(ctx, 'credentials_list_types', async () => {\n const filter = definedInput({ name });\n const data = await ctx.gql.workspace.request<{ getProviders: unknown }>(\n LIST_CREDENTIAL_TYPES,\n {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: pagination(limit, offset),\n },\n );\n return jsonResult(data.getProviders);\n }),\n );\n\n // BOFF-8720: the deployed `createConnection` resolver at\n // Algoshred/wspace-integrations-svc (PR #66, merged) now does a\n // `findFirst({ where: { OR: [{ id }, { key }] } })` so it accepts both\n // cuid and key forms of `providerId` AND persists the resolved\n // `provider.id` (not the raw input) to the FK column. The tool is\n // re-enabled here.\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_create')),\n {\n title: 'Create Credential',\n description:\n 'Create a connection against a provider. Secrets go to the vault; pass a reference, never a raw secret in config.',\n inputSchema: {\n name: z.string().describe('Connection name'),\n providerId: z.string().describe('Provider ID or key (e.g. \"openai\")'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Non-secret provider config as JSON'),\n context: z.unknown().optional().describe('Context JSON'),\n vaultId: z.string().optional().describe('Vault to store secret material in'),\n credentialSecretId: z.string().optional().describe('Existing vault secret reference'),\n managedSecretName: z.string().optional().describe('Managed secret name'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async (args) =>\n runTool(ctx, 'credentials_create', async () => {\n const data = await ctx.gql.workspace.request<{ createConnection: unknown }>(\n CREATE_CREDENTIAL,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_update')),\n {\n title: 'Update Credential',\n description: 'Update a connection’s name, description or non-secret config.',\n inputSchema: {\n id: z.string().describe('Connection ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Non-secret provider config as JSON'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'credentials_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateConnection: unknown }>(\n UPDATE_CREDENTIAL,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_delete')),\n {\n title: 'Delete Credential',\n description:\n 'Delete a connection. Set deleteVaultSecret to also destroy the stored secret — that is irreversible.',\n annotations: { destructiveHint: true },\n inputSchema: {\n id: z.string().describe('Connection ID'),\n deleteVaultSecret: z.boolean().optional().describe('Also delete the vault secret'),\n },\n },\n async ({ id, deleteVaultSecret }) =>\n runTool(ctx, 'credentials_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteConnection: unknown }>(\n DELETE_CREDENTIAL,\n { id, deleteVaultSecret },\n );\n return jsonResult(data.deleteConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_test')),\n {\n title: 'Test Credential',\n description: 'Verify a connection can authenticate against its provider.',\n annotations: { readOnlyHint: true },\n inputSchema: { connectionId: z.string().describe('Connection ID') },\n },\n async ({ connectionId }) =>\n runTool(ctx, 'credentials_test', async () => {\n const data = await ctx.gql.workspace.request<{ testConnection: unknown }>(TEST_CREDENTIAL, {\n connectionId,\n });\n return jsonResult(data.testConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_auth_api_key')),\n {\n title: 'Authenticate Credential (API key)',\n description: 'Attach an API key to a connection via the API-key auth flow.',\n inputSchema: {\n connectionId: z.string().describe('Connection ID'),\n apiKey: z.string().describe('API key to store'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ connectionId, apiKey }) =>\n runTool(ctx, 'credentials_auth_api_key', async () => {\n const data = await ctx.gql.workspace.request<{ authenticateWithApiKey: unknown }>(\n AUTHENTICATE_CREDENTIAL_API_KEY,\n { input: { connectionId, apiKey } },\n );\n return jsonResult(data.authenticateWithApiKey);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_auth_basic')),\n {\n title: 'Authenticate Credential (basic)',\n description: 'Attach basic-auth credentials to a connection.',\n inputSchema: {\n connectionId: z.string().describe('Connection ID'),\n username: z.string().describe('Username'),\n password: z.string().describe('Password'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ connectionId, username, password }) =>\n runTool(ctx, 'credentials_auth_basic', async () => {\n const data = await ctx.gql.workspace.request<{ authenticateWithBasicAuth: unknown }>(\n AUTHENTICATE_CREDENTIAL_BASIC,\n { input: { connectionId, username, password } },\n );\n return jsonResult(data.authenticateWithBasicAuth);\n }),\n );\n}\n","/**\n * FluidGrids workflow data tools (BOFF-10887): variables, data tables, static\n * data and pinned node data.\n *\n * Variables are workflow configuration, so they can be created, changed and\n * deleted here. A secret or externally backed variable's value never reaches\n * the client: the backend returns null for it, and these tools drop it again\n * in case a backend ever does not. Revealing a value is left to the app.\n *\n * Data tables and static data are customer data the workflows read and write\n * at run time; they are read-only here. Pins only affect TEST runs.\n */\n\nimport { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { errorResult, jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport * as ops from '../extended-operations.js';\nimport {\n DESTRUCTIVE_WRITE,\n INTERNAL_WRITE,\n READ_ONLY,\n definedInput,\n fluidgridsToolkit,\n} from './helpers.js';\n\nconst text = z.string().trim().min(1);\nconst VariableScopeEnum = z.enum(['WORKSPACE', 'PROJECT']);\nconst SecretProviderEnum = z.enum([\n 'NONE',\n 'AWS_SECRETS_MANAGER',\n 'AZURE_KEY_VAULT',\n 'GCP_SECRET_MANAGER',\n 'VAULT',\n]);\nconst StaticDataScopeEnum = z.enum(['GLOBAL', 'NODE']);\nconst FilterOpEnum = z.enum([\n 'EQ',\n 'NEQ',\n 'GT',\n 'GTE',\n 'LT',\n 'LTE',\n 'CONTAINS',\n 'IS_NULL',\n 'IS_NOT_NULL',\n]);\n\ninterface VariableRow {\n isSecret?: boolean;\n externalProvider?: string;\n value?: unknown;\n}\n\ninterface VariableResult {\n variable?: VariableRow | null;\n}\n\n/** Drop the value of a secret or externally backed variable, whatever the backend sent. */\nfunction shown<T extends VariableRow | null | undefined>(variable: T): T {\n if (!variable) return variable;\n const hidden =\n variable.isSecret === true ||\n (variable.externalProvider !== undefined && variable.externalProvider !== 'NONE');\n return hidden ? { ...variable, value: null } : variable;\n}\n\nfunction shownResult(result: VariableResult | null): VariableResult | null {\n return result?.variable ? { ...result, variable: shown(result.variable) } : result;\n}\n\n/** The SDK's rule: a variable holds a value or points at an external secret, never both. */\nfunction variableSourceError(\n provider: string | undefined,\n externalRef: string | undefined,\n value: string | undefined,\n creating: boolean,\n): string | undefined {\n if (provider !== undefined && provider !== 'NONE') {\n if (creating && externalRef === undefined) {\n return 'externalRef is required with an externalProvider other than NONE.';\n }\n if (value !== undefined) return 'A variable has a value or an external reference, not both.';\n } else if (externalRef !== undefined && (provider === 'NONE' || creating)) {\n return 'externalRef needs an externalProvider other than NONE.';\n }\n return undefined;\n}\n\nexport function registerDataTools(\n server: McpServer,\n ctx: McpContext,\n track: (name: string) => string,\n): void {\n const { tool, request } = fluidgridsToolkit(server, ctx, track);\n\n // ── Variables ──────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'variables_list'),\n 'List Variables',\n 'Workflow variables ($vars), in key order (at most 500). Secret and externally backed values are returned as null.',\n {\n projectId: text.optional().describe('Only this project'),\n scope: VariableScopeEnum.optional().describe('WORKSPACE or PROJECT'),\n },\n READ_ONLY,\n async (args) => {\n const page = await request<{ variables?: VariableRow[] }>(\n ops.LIST_WORKFLOW_VARIABLES,\n 'workflowVariables',\n args,\n );\n if (!page?.variables) return jsonResult(page);\n return jsonResult({ ...page, variables: page.variables.map((v) => shown(v)) });\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'variables_get'),\n 'Get Variable',\n 'One workflow variable; null when there is none. A secret or externally backed value is returned as null.',\n { id: text.describe('Variable ID') },\n READ_ONLY,\n async (args) =>\n jsonResult(\n shown(await request<VariableRow>(ops.GET_WORKFLOW_VARIABLE, 'workflowVariable', args)),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'variables_create'),\n 'Create Variable',\n 'Create a workflow variable. Give it a value (isSecret: true stores it encrypted and never shows it again), or point it at an external secret with externalProvider + externalRef. scope PROJECT needs a projectId. A refusal (for example a taken key) comes back as success: false.',\n {\n key: z\n .string()\n .regex(/^[A-Za-z0-9_-]+$/, 'Letters, digits, _ and - only')\n .describe('Variable key, used as $vars.<key>'),\n value: z.string().optional().describe('Value (leave out for an external reference)'),\n isSecret: z.boolean().optional().describe('Store encrypted and never show it again'),\n description: z.string().optional().describe('Description'),\n scope: VariableScopeEnum.optional().describe('WORKSPACE (default) or PROJECT'),\n projectId: text.optional().describe('Project ID, with scope PROJECT only'),\n externalProvider: SecretProviderEnum.optional().describe('External secret store'),\n externalRef: text.optional().describe('Name of the secret in that store'),\n },\n INTERNAL_WRITE,\n async (args) => {\n if (args.scope === 'PROJECT' && args.projectId === undefined) {\n return errorResult(\"projectId is required when scope is 'PROJECT'.\");\n }\n if (args.scope !== 'PROJECT' && args.projectId !== undefined) {\n return errorResult(\"projectId only goes with scope 'PROJECT'.\");\n }\n const sourceError = variableSourceError(\n args.externalProvider,\n args.externalRef,\n args.value,\n true,\n );\n if (sourceError) return errorResult(sourceError);\n return jsonResult(\n shownResult(\n await request<VariableResult>(ops.CREATE_WORKFLOW_VARIABLE, 'createWorkflowVariable', {\n input: definedInput({ ...args }),\n }),\n ),\n );\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'variables_update'),\n 'Update Variable',\n 'Change a workflow variable. Workflows read the new value on their next run. The old value of a secret variable cannot be read back, so overwriting it is final.',\n {\n id: text.describe('Variable ID'),\n value: z.string().optional().describe('New value'),\n isSecret: z.boolean().optional().describe('Store encrypted'),\n description: z.string().optional().describe('Description'),\n externalProvider: SecretProviderEnum.optional().describe('External secret store'),\n externalRef: text.optional().describe('Name of the secret in that store'),\n },\n DESTRUCTIVE_WRITE,\n async ({ id, ...input }) => {\n const sourceError = variableSourceError(\n input.externalProvider,\n input.externalRef,\n input.value,\n false,\n );\n if (sourceError) return errorResult(sourceError);\n const changes = definedInput(input);\n if (Object.keys(changes).length === 0) return errorResult('Nothing to update.');\n return jsonResult(\n shownResult(\n await request<VariableResult>(ops.UPDATE_WORKFLOW_VARIABLE, 'updateWorkflowVariable', {\n id,\n input: changes,\n }),\n ),\n );\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'variables_delete'),\n 'Delete Variable',\n 'Delete a workflow variable. Workflows that read it get no value from their next run on.',\n { id: text.describe('Variable ID') },\n DESTRUCTIVE_WRITE,\n async (args) =>\n jsonResult(await request(ops.DELETE_WORKFLOW_VARIABLE, 'deleteWorkflowVariable', args)),\n );\n\n // ── Data tables (read-only) ────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'data_tables_list'),\n 'List Data Tables',\n 'The data tables of the workspace with their columns and row counts. `total` is how many match.',\n {\n search: z.string().optional().describe('Name search'),\n limit: z.number().int().min(1).optional().describe('Page size'),\n offset: z.number().int().min(0).optional().describe('Offset'),\n },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.LIST_DATA_TABLES, 'dataTables', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'data_tables_get'),\n 'Get Data Table',\n 'One data table with its columns; null when there is none.',\n { id: text.describe('Data table ID') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_DATA_TABLE, 'dataTable', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'data_tables_query_rows'),\n 'Query Data Table Rows',\n 'Rows of a data table, newest first, optionally filtered by column. IS_NULL and IS_NOT_NULL take no value; the other operators need one.',\n {\n tableId: text.describe('Data table ID'),\n filters: z\n .array(\n z\n .object({\n column: text.describe('Column key'),\n op: FilterOpEnum.describe('Comparison'),\n value: z.unknown().optional().describe('Value to compare with'),\n })\n .strict(),\n )\n .optional()\n .describe('All must match'),\n limit: z.number().int().min(1).max(5000).optional().describe('Page size, 1-5000'),\n offset: z.number().int().min(0).optional().describe('Offset'),\n },\n READ_ONLY,\n async ({ filters, ...rest }) => {\n for (const [index, filter] of (filters ?? []).entries()) {\n const takesNoValue = filter.op === 'IS_NULL' || filter.op === 'IS_NOT_NULL';\n if (takesNoValue && filter.value !== undefined) {\n return errorResult(`filters[${index}]: ${filter.op} takes no value.`);\n }\n if (!takesNoValue && (filter.value === undefined || filter.value === null)) {\n return errorResult(`filters[${index}]: ${filter.op} needs a value.`);\n }\n }\n return jsonResult(\n await request(ops.QUERY_DATA_TABLE_ROWS, 'dataTableRows', {\n input: definedInput({ ...rest, filters }),\n }),\n );\n },\n );\n\n // ── Static data (read-only) ────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'static_data_get'),\n 'Get Static Data',\n 'The state a workflow keeps between runs (for example a polling trigger’s cursor): the GLOBAL blob, or one NODE blob by nodeId. Null when there is none.',\n {\n workflowKey: text.describe('Workflow key'),\n scope: StaticDataScopeEnum.describe('GLOBAL, or NODE with a nodeId'),\n nodeId: text.optional().describe('Graph node ID (NODE scope only)'),\n },\n READ_ONLY,\n async (args) => {\n if (args.scope === 'NODE' && args.nodeId === undefined) {\n return errorResult('nodeId is required with the NODE scope.');\n }\n if (args.scope === 'GLOBAL' && args.nodeId !== undefined) {\n return errorResult('nodeId applies to the NODE scope only.');\n }\n return jsonResult(await request(ops.GET_WORKFLOW_STATIC_DATA, 'workflowStaticData', args));\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'static_data_list'),\n 'List Static Data',\n 'Every static-data blob of a workflow: the GLOBAL one first, then one per node.',\n { workflowKey: text.describe('Workflow key') },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.LIST_WORKFLOW_STATIC_DATA, 'workflowStaticDataList', args)),\n );\n\n // ── Pinned data ────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'pinned_data_pin'),\n 'Pin Node Data',\n 'Pin the output a node returns in TEST runs of one stored workflow version (by its row id, not its key). Replaces the node’s earlier pin. PRODUCTION runs never use pins.',\n {\n id: text.describe('Workflow definition (version row) ID'),\n nodeId: text.describe('Graph node ID'),\n data: z\n .unknown()\n .refine((value) => value !== undefined && value !== null, 'data must be a JSON value')\n .describe('The output to pin, as JSON'),\n },\n INTERNAL_WRITE,\n async (args) => jsonResult(await request(ops.PIN_NODE_DATA, 'pinNodeData', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'pinned_data_unpin'),\n 'Unpin Node Data',\n 'Remove the pinned output of a node, so TEST runs execute it again. The pinned data is gone afterwards.',\n {\n id: text.describe('Workflow definition (version row) ID'),\n nodeId: text.describe('Graph node ID'),\n },\n DESTRUCTIVE_WRITE,\n async (args) => jsonResult(await request(ops.UNPIN_NODE_DATA, 'unpinNodeData', args)),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n GET_DASHBOARD_SUMMARY,\n GET_SYSTEM_CONFIG,\n GET_USAGE_METRICS,\n SEARCH,\n SEARCH_BY_ENTITY_TYPE,\n} from '../operations.js';\nimport { definedInput, normalizeDate, runTool } from './helpers.js';\n\n/**\n * Read-only cross-cutting tools: dashboard, usage, search and system config.\n * Grouped in one file because each is one or two operations and they share no\n * domain object with the workflow surface.\n */\nexport function registerInsightTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'dashboard_summary')),\n {\n title: 'Dashboard Summary',\n description: 'Workflow, run and failure counters for the current workspace.',\n annotations: { readOnlyHint: true },\n inputSchema: { projectId: z.string().optional().describe('Scope to one project') },\n },\n async ({ projectId }) =>\n runTool(ctx, 'dashboard_summary', async () => {\n const data = await ctx.gql.workspace.request<{ dashboardSummary: unknown }>(\n GET_DASHBOARD_SUMMARY,\n { projectId },\n );\n return jsonResult(data.dashboardSummary);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'usage_metrics')),\n {\n title: 'Usage Metrics',\n description: 'Usage metrics over a date range — run minutes and execution counts.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n startDate: z.string().describe('ISO 8601 start of the range'),\n endDate: z.string().describe('ISO 8601 end of the range'),\n userId: z.string().optional().describe('Scope to one user'),\n contextFilter: z.unknown().optional().describe('Context filter as JSON'),\n },\n },\n async (args) =>\n runTool(ctx, 'usage_metrics', async () => {\n const normalised: Record<string, unknown> = {\n ...args,\n startDate: normalizeDate(args.startDate, false),\n endDate: normalizeDate(args.endDate, true),\n };\n const data = await ctx.gql.workspace.request<{ usageMetrics: unknown }>(GET_USAGE_METRICS, {\n input: definedInput(normalised),\n });\n return jsonResult(data.usageMetrics);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'search')),\n {\n title: 'Search',\n description: 'Search across FluidGrids entities. Narrow with entityTypes when you know it.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n query: z.string().describe('Search query'),\n entityTypes: z.array(z.string()).optional().describe('Restrict to these entity types'),\n filters: z.unknown().optional().describe('Additional filters as JSON'),\n highlight: z.boolean().optional().describe('Return highlighted snippets'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async (args) =>\n runTool(ctx, 'search', async () => {\n const data = await ctx.gql.workspace.request<{ search: unknown }>(SEARCH, {\n input: definedInput({ ...args }),\n });\n return jsonResult(data.search);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'search_by_entity_type')),\n {\n title: 'Search By Entity Type',\n description: 'Search within a single entity type.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n entityType: z.string().describe('Entity type to search'),\n query: z.string().describe('Search query'),\n filters: z.unknown().optional().describe('Additional filters as JSON'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async (args) =>\n runTool(ctx, 'search_by_entity_type', async () => {\n const data = await ctx.gql.workspace.request<{ searchByEntityType: unknown }>(\n SEARCH_BY_ENTITY_TYPE,\n definedInput({ ...args }),\n );\n return jsonResult(data.searchByEntityType);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'system_config')),\n {\n title: 'System Config',\n description: 'Read the workflow engine’s effective system configuration.',\n annotations: { readOnlyHint: true },\n inputSchema: {},\n },\n async () =>\n runTool(ctx, 'system_config', async () => {\n const data = await ctx.gql.workspace.request<{ systemConfig: unknown }>(GET_SYSTEM_CONFIG);\n return jsonResult(data.systemConfig);\n }),\n );\n}\n","/**\n * FluidGrids inspection tools (BOFF-10887): read what a workflow, a run, a node\n * or the workspace's integrations look like, without changing anything. The two\n * writes here only bring something back: a workflow version as a new DRAFT, and\n * a deleted scheduled job.\n *\n * Operations the SDK has that are deliberately NOT tools (re-running a run or a\n * node, deciding a tool approval, configuring log streams or secrets providers,\n * installing nodes, live subscriptions) are listed with the reason in\n * .parity-allowlist.yaml.\n */\n\nimport { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { errorResult, jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport * as ops from '../extended-operations.js';\nimport {\n INTERNAL_WRITE,\n READ_ONLY,\n definedInput,\n fluidgridsToolkit,\n normalizeDate,\n workflowPagination,\n} from './helpers.js';\n\nconst text = z.string().trim().min(1);\nconst limit = z.number().int().min(1);\nconst offset = z.number().int().min(0);\nconst date = (what: string): z.ZodString =>\n z.string().describe(`${what}: ISO 8601 date-time, or a date (YYYY-MM-DD) for the whole day`);\n\ninterface NodeStateRow {\n id: string;\n nodeId: string;\n}\n\nexport function registerInspectTools(\n server: McpServer,\n ctx: McpContext,\n track: (name: string) => string,\n): void {\n const { tool, request } = fluidgridsToolkit(server, ctx, track);\n\n // ── Workflows ──────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'workflows_summary'),\n 'Workflow Summary',\n 'How many versions a workflow has, which is the latest, and when it was created and last changed.',\n { workflowKey: text.describe('Workflow key') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_WORKFLOW_SUMMARY, 'workflowSummary', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_diff_versions'),\n 'Diff Workflow Versions',\n 'How two versions of a workflow differ: one entry per changed path of the definition (at most 2000; `truncated` says when more changed).',\n {\n workflowKey: text.describe('Workflow key'),\n fromVersion: text.describe('Older version'),\n toVersion: text.describe('Newer version'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.DIFF_WORKFLOW_VERSIONS, 'workflowVersionDiff', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_restore_version'),\n 'Restore Workflow Version',\n 'Copy an old version of a workflow into a new DRAFT version. The old version and the active one are not changed; publish the draft to make it live.',\n { workflowKey: text.describe('Workflow key'), version: text.describe('Version to copy') },\n INTERNAL_WRITE,\n async (args) =>\n jsonResult(await request(ops.RESTORE_WORKFLOW_VERSION, 'restoreWorkflowVersion', args)),\n );\n\n // ── Runs ───────────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'runs_hierarchy'),\n 'Run Hierarchy',\n 'The tree of sub-workflow runs a run started, up to six levels deep, with the node of the parent that started each one.',\n { runId: text.describe('Run ID') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_RUN_HIERARCHY, 'workflowRunHierarchy', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_node_states'),\n 'Run Node States',\n 'Every node execution of a run with its status, error and output. Poll this to follow a run while it is going: MCP has no live subscription.',\n { runId: text.describe('Run ID') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.LIST_NODE_STATES, 'nodeStates', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_node_state'),\n 'Run Node State',\n 'One node execution with the inputs it received. Pass the node state `id` from fluidgrids_runs_node_states, or a `runId` and graph `nodeId` (refused when that node ran in parallel instances; then pass the id).',\n {\n id: text.optional().describe('Node state ID'),\n runId: text.optional().describe('Run ID (with nodeId)'),\n nodeId: text.optional().describe('Graph node ID (with runId)'),\n },\n READ_ONLY,\n async ({ id, runId, nodeId }) => {\n if (id !== undefined) {\n if (runId !== undefined || nodeId !== undefined) {\n return errorResult('Pass either id, or runId and nodeId, not both.');\n }\n return jsonResult(await request(ops.GET_NODE_STATE, 'nodeState', { id }));\n }\n if (runId === undefined || nodeId === undefined) {\n return errorResult('Pass a node state id, or both runId and nodeId.');\n }\n const states = await request<NodeStateRow[]>(ops.LIST_NODE_STATES, 'nodeStates', { runId });\n const matching = (states ?? []).filter((state) => state.nodeId === nodeId);\n if (matching.length === 0) return jsonResult(null);\n if (matching.length > 1) {\n return errorResult(\n `Node ${nodeId} has ${matching.length} states in run ${runId} (parallel instances); pass one of these ids instead: ${matching.map((s) => s.id).join(', ')}`,\n );\n }\n return jsonResult(await request(ops.GET_NODE_STATE, 'nodeState', { id: matching[0].id }));\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_can_run_from_node'),\n 'Can Run From Node',\n 'Read-only check whether a new run could start at a node of a past run, reusing its upstream outputs, and what blocks it if not.',\n {\n sourceRunId: text.describe('The past run to reuse'),\n nodeId: text.describe('Graph node ID to start at'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.CAN_RUN_FROM_NODE, 'runFromNodeEligibility', { input: args })),\n );\n\n // ── Nodes ──────────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'nodes_list_custom'),\n 'List Custom Nodes',\n 'The custom nodes registered for the workspace, page by page.',\n {\n page: limit.optional().describe('Page number, from 1'),\n limit: limit.optional().describe('Page size'),\n },\n READ_ONLY,\n async ({ page, limit: size }) => {\n const pagination = definedInput({ page, limit: size });\n return jsonResult(\n await request(ops.LIST_CUSTOM_NODES, 'customNodes', {\n pagination: Object.keys(pagination).length > 0 ? pagination : undefined,\n }),\n );\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_manifest'),\n 'Node Manifest',\n 'The manifest of one node version (inputs, operations, credentials), as JSON. Null when there is no such node. It can be large.',\n {\n nodeType: text.describe('Node type, e.g. internal:http'),\n version: text.describe('Node version'),\n },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_NODE_MANIFEST, 'nodeManifest', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_usage_status'),\n 'Node Usage Status',\n 'Which workflows of the workspace use a node version.',\n { nodeType: text.describe('Node type'), nodeVersion: text.describe('Node version') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_NODE_USAGE_STATUS, 'nodeUsageStatus', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_list_operation_configs'),\n 'List Operation Configs',\n 'The stored configurations of node operations, newest first, optionally for one node type and version.',\n {\n nodeType: text.optional().describe('Node type'),\n nodeVersion: text.optional().describe('Node version'),\n limit: limit.optional().describe('Page size'),\n offset: offset.optional().describe('Offset'),\n },\n READ_ONLY,\n async ({ nodeType, nodeVersion, limit: size, offset: from }) =>\n jsonResult(\n await request(ops.LIST_OPERATION_CONFIGS, 'operationConfigs', {\n nodeType,\n nodeVersion,\n pagination: workflowPagination(size, from),\n }),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_get_operation_config'),\n 'Get Operation Config',\n 'The stored configuration of one operation of one node version; null when there is none.',\n {\n nodeType: text.describe('Node type'),\n nodeVersion: text.describe('Node version'),\n operationName: text.describe('Operation name'),\n },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_OPERATION_CONFIG, 'operationConfig', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_list_installations'),\n 'List Node Installations',\n 'The nodes this workspace has installed, whether each is enabled, and its workspace settings.',\n {},\n READ_ONLY,\n async () =>\n jsonResult(await request(ops.LIST_NODE_INSTALLATIONS, 'workspaceNodeInstallations')),\n );\n\n // ── Webhook deliveries ─────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'webhooks_list_deliveries'),\n 'List Webhook Deliveries',\n 'The newest requests that reached one webhook, with validation result, the run it started and any error. Credentials in headers are masked by the backend; bodies are what the sender sent.',\n {\n eventRegistrationId: text.describe('Webhook (event registration) ID'),\n limit: limit.optional().describe('How many (default 50)'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.LIST_WEBHOOK_DELIVERIES, 'webhookDeliveryLogs', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'webhooks_list_all_deliveries'),\n 'List All Webhook Deliveries',\n 'The newest webhook requests across every webhook of the workspace. Filter with validationPassed: false to find rejected ones.',\n {\n limit: z.number().int().min(1).max(100).optional().describe('How many, 1-100 (default 50)'),\n offset: offset.optional().describe('Offset'),\n validationPassed: z.boolean().optional().describe('Only passed (true) or failed (false)'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.LIST_ALL_WEBHOOK_DELIVERIES, 'allWebhookDeliveries', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'webhooks_list_filters'),\n 'List Webhook Filters',\n 'The event filters a request must pass before a webhook starts a run.',\n { eventRegistrationId: text.describe('Webhook (event registration) ID') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.LIST_WEBHOOK_EVENT_FILTERS, 'eventFilters', args)),\n );\n\n // ── Scheduled jobs ─────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'scheduled_jobs_scheduler_status'),\n 'Scheduler Status',\n 'A snapshot of the workflow scheduler: whether it runs and how many schedules the answering process holds.',\n {},\n READ_ONLY,\n async () => jsonResult(await request(ops.GET_SCHEDULER_STATUS, 'workflowScheduledJobsStatus')),\n );\n\n tool(\n mcpToolName(ctx.productName, 'scheduled_jobs_restore'),\n 'Restore Scheduled Job',\n 'Bring back a deleted scheduled job. It runs on its schedule again if it was enabled.',\n { jobId: text.describe('Scheduled job ID') },\n { ...INTERNAL_WRITE, openWorldHint: true },\n async (args) =>\n jsonResult(await request(ops.RESTORE_SCHEDULED_JOB, 'restoreScheduledJob', args)),\n );\n\n // ── Insights ───────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'dashboard_error_analytics'),\n 'Error Analytics',\n 'Failed runs and nodes over a window (the 30 days before endDate, now by default): errors by type, the workflows and nodes that fail most, and a daily trend.',\n {\n startDate: date('Start of the window').optional(),\n endDate: date('End of the window').optional(),\n limit: limit.optional().describe('How many top workflows and nodes'),\n },\n READ_ONLY,\n async ({ startDate, endDate, limit: top }) =>\n jsonResult(\n await request(ops.GET_ERROR_ANALYTICS, 'errorAnalytics', {\n input: definedInput({\n startDate: normalizeDate(startDate, false),\n endDate: normalizeDate(endDate, true),\n limit: top,\n }),\n }),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'usage_time_series'),\n 'Usage Time Series',\n 'Runs (by outcome), node executions and durations per time bucket over a date range.',\n {\n startDate: date('Start of the range'),\n endDate: date('End of the range'),\n granularity: z.enum(['hour', 'day', 'week', 'month']).optional().describe('Default day'),\n userId: text.optional().describe('Only runs this user started'),\n },\n READ_ONLY,\n async ({ startDate, endDate, granularity, userId }) =>\n jsonResult(\n await request(ops.GET_USAGE_TIME_SERIES, 'usageTimeSeries', {\n input: definedInput({\n startDate: normalizeDate(startDate, false),\n endDate: normalizeDate(endDate, true),\n granularity,\n userId,\n }),\n }),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'usage_detailed_node_usage'),\n 'Detailed Node Usage',\n 'Executions, outcomes and duration statistics per node type and version over a date range.',\n {\n startDate: date('Start of the range'),\n endDate: date('End of the range'),\n nodeType: text.optional().describe('Only this node type'),\n },\n READ_ONLY,\n async ({ startDate, endDate, nodeType }) =>\n jsonResult(\n await request(ops.GET_DETAILED_NODE_USAGE, 'detailedNodeUsage', {\n input: definedInput({\n startDate: normalizeDate(startDate, false),\n endDate: normalizeDate(endDate, true),\n nodeType,\n }),\n }),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'usage_billing_summary'),\n 'Usage Billing Summary',\n 'Runs, node executions, node minutes and the estimated cost over a date range. Read-only: nothing is charged.',\n { startDate: date('Start of the range'), endDate: date('End of the range') },\n READ_ONLY,\n async ({ startDate, endDate }) =>\n jsonResult(\n await request(ops.GET_BILLING_SUMMARY, 'billingSummary', {\n input: {\n startDate: normalizeDate(startDate, false),\n endDate: normalizeDate(endDate, true),\n },\n }),\n ),\n );\n\n // ── Tool approvals ─────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'tool_approvals_list_pending'),\n 'List Pending Tool Approvals',\n 'AI Agent tool calls that wait for a person to approve or reject them. Deciding is left to a person in the FluidGrids app on purpose.',\n {\n limit: limit.optional().describe('Page size (default 50)'),\n offset: offset.optional().describe('Offset'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.LIST_PENDING_TOOL_APPROVALS, 'pendingToolApprovals', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'tool_approvals_get'),\n 'Get Tool Approval',\n 'One tool-approval request: the tool calls it holds, the decisions made, and its timeout.',\n { id: text.describe('Tool approval request ID') },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.GET_TOOL_APPROVAL_REQUEST, 'toolApprovalRequest', args)),\n );\n\n // ── Log streams and secrets providers ──────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'log_streams_list'),\n 'List Log Streams',\n 'Where the workspace streams run logs, and how the last dispatch went. Stored secrets are never returned (`hasSecret` says whether one is set).',\n {},\n READ_ONLY,\n async () =>\n jsonResult(await request(ops.LIST_LOG_STREAM_DESTINATIONS, 'logStreamDestinations')),\n );\n\n tool(\n mcpToolName(ctx.productName, 'log_streams_get'),\n 'Get Log Stream',\n 'One log stream destination; the stored secret is never returned.',\n { id: text.describe('Log stream destination ID') },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.GET_LOG_STREAM_DESTINATION, 'logStreamDestination', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'secrets_providers_list'),\n 'List Secrets Providers',\n 'The external secret stores the workspace has configured (AWS, Azure, GCP, Vault) and their last connection test. No credential is returned.',\n {},\n READ_ONLY,\n async () =>\n jsonResult(await request(ops.LIST_SECRETS_PROVIDER_CONFIGS, 'secretsProviderConfigs')),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport { GET_NODE, LIST_NODES } from '../operations.js';\nimport { runTool, workflowPagination } from './helpers.js';\n\nconst PublishTypeEnum = z.enum(['BUILTIN', 'CUSTOM', 'STORE']);\nconst NodeConfigStatusEnum = z.enum(['AVAILABLE', 'DEPRECATED', 'DISABLED']);\n\nexport function registerNodeTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'nodes_list')),\n {\n title: 'List Nodes',\n description:\n 'List the node types available to build workflows with, from the node endpoint config registry.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n nodeType: z.string().optional().describe('Filter by node type'),\n publishType: PublishTypeEnum.optional().describe('BUILTIN, CUSTOM or STORE'),\n status: NodeConfigStatusEnum.optional().describe('Filter by availability'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ nodeType, publishType, status, limit, offset }) =>\n runTool(ctx, 'nodes_list', async () => {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfigs: unknown }>(LIST_NODES, {\n nodeType,\n publishType,\n status,\n pagination: workflowPagination(limit, offset),\n });\n return jsonResult(data.nodeEndpointConfigs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'nodes_get')),\n {\n title: 'Get Node',\n description:\n 'Get one node type at a specific version, including its input fields and operations.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n nodeType: z.string().describe('Node type identifier'),\n nodeVersion: z.string().describe('Node version'),\n },\n },\n async ({ nodeType, nodeVersion }) =>\n runTool(ctx, 'nodes_get', async () => {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfig: unknown }>(GET_NODE, {\n nodeType,\n nodeVersion,\n });\n return jsonResult(data.nodeEndpointConfig);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { errorResult, jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CANCEL_RUN,\n GET_RUN,\n GET_RUN_LOGS,\n LIST_RUNS,\n PAUSE_RUN,\n RESUME_RUN,\n RETRY_RUN,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// The deployed RunStatus enum is UPPERCASE. Comparing against lowercase is what\n// made `fluidgrids runs wait` never terminate (BOFF-7091) — keep these exact.\nconst RunStatusEnum = z.enum([\n 'CANCELLED',\n 'COMPLETED',\n 'FAILED',\n 'PENDING',\n 'RUNNING',\n 'TERMINATED',\n 'WAITING',\n]);\nconst RunLogLevelEnum = z.enum(['DEBUG', 'ERROR', 'INFO', 'WARN']);\n\nexport function registerRunTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_list')),\n {\n title: 'List Runs',\n description: 'List workflow runs, optionally filtered by workflowKey and status.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n status: RunStatusEnum.optional().describe('Filter by run status'),\n limit: z.number().optional().describe('Max results (default 10)'),\n offset: z.number().optional().describe('Offset for pagination (default 0)'),\n },\n },\n async ({ workflowKey, status, limit, offset }) =>\n runTool(ctx, 'runs_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRuns: unknown }>(LIST_RUNS, {\n input: definedInput({ workflowKey, status, limit, offset }),\n });\n return jsonResult(data.workflowRuns);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_get')),\n {\n title: 'Get Run',\n description:\n 'Get one workflow run, including per-node state. Poll this to follow a run to a terminal status.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRun: unknown }>(GET_RUN, { id });\n return jsonResult(data.workflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_logs')),\n {\n title: 'Get Run Logs',\n description:\n 'Read a run log, newest page first. Keyset paginated: pass the previous page cursor as `after`.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n runId: z.string().describe('Run ID'),\n nodeId: z.string().optional().describe('Restrict to one node'),\n minLevel: RunLogLevelEnum.optional().describe('Minimum log level'),\n limit: z.number().optional().describe('Max log lines'),\n after: z.string().optional().describe('Keyset cursor from a previous page'),\n search: z.string().optional().describe('Substring filter'),\n includeChildRuns: z.boolean().optional().describe('Include logs from child runs'),\n },\n },\n async (args) =>\n runTool(ctx, 'runs_logs', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRunLogs: unknown }>(\n GET_RUN_LOGS,\n definedInput({ ...args }),\n );\n return jsonResult(data.workflowRunLogs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_cancel')),\n {\n title: 'Cancel Run',\n description: 'Cancel an in-flight run. Terminal runs cannot be cancelled.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_cancel', async () => {\n const data = await ctx.gql.workspace.request<{ cancelWorkflowRun: unknown }>(CANCEL_RUN, {\n id,\n });\n return jsonResult(data.cancelWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_pause')),\n {\n title: 'Pause Run',\n description: 'Pause a running workflow run.',\n inputSchema: { id: z.string().describe('Run ID') },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_pause', async () => {\n const data = await ctx.gql.workspace.request<{ pauseWorkflowRun: unknown }>(PAUSE_RUN, {\n id,\n });\n return jsonResult(data.pauseWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_resume')),\n {\n title: 'Resume Run',\n description:\n 'Resume a paused or waiting run. `payload` supplies the data a Wait node is blocked on.',\n inputSchema: {\n id: z.string().describe('Run ID'),\n payload: z.unknown().optional().describe('Payload to resume with'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n async ({ id, payload }) =>\n runTool(ctx, 'runs_resume', async () => {\n const data = await ctx.gql.workspace.request<{ resumeWorkflowRun: unknown }>(RESUME_RUN, {\n id,\n payload,\n });\n return jsonResult(data.resumeWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_retry_node')),\n {\n title: 'Retry Node',\n description: 'Re-execute one failed node within a run, continuing from there.',\n inputSchema: {\n id: z.string().describe('Run ID'),\n nodeId: z.string().describe('Node ID to retry'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n async ({ id: runId, nodeId }) =>\n runTool(ctx, 'runs_retry_node', async () => {\n // The deployed resolver takes a NodeState id, not a run id. Look the run\n // up to find the matching NodeState, then forward that id.\n const runData = await ctx.gql.workspace.request<{\n workflowRun: { nodeStates: Array<{ id: string; nodeId: string; status: string }> } | null;\n }>(GET_RUN, { id: runId });\n const states =\n runData.workflowRun?.nodeStates?.filter(\n (s) => s.nodeId === nodeId && ['FAILED', 'TIMEOUT'].includes(s.status),\n ) ?? [];\n const [state] = states;\n if (!state || states.length !== 1) {\n return errorResult(`Expected one failed node state for run ${runId} node ${nodeId}`);\n }\n const data = await ctx.gql.workspace.request<{ retryNode: unknown }>(RETRY_RUN, {\n id: state.id,\n nodeId,\n });\n return jsonResult(data.retryNode);\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport {\n jsonResult,\n mcpToolName,\n registerTool,\n McpUserError,\n type McpContext,\n type ToolResult,\n type ToolAnnotations,\n} from '../../../core/index.js';\nimport * as ops from '../durable-operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\nconst text = z.string().trim().min(1);\nconst json = z\n .unknown()\n .refine((value) => value !== undefined && value !== null, 'JSON is required');\nconst target = z\n .object({ workflowKey: text, workflowId: text.max(256), firstRunId: text.optional() })\n .strict();\nconst run = z\n .union([text, target])\n .describe('A run ID or a workflowKey/workflowId target, optionally pinned by firstRunId');\nconst read = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };\nconst write = { readOnlyHint: false, destructiveHint: false, openWorldHint: true };\nconst destructive = { readOnlyHint: false, destructiveHint: true, openWorldHint: true };\nconst duration = z.union([z.number().int().nonnegative(), text]).transform(String);\n\nconst startShape = {\n workflowKey: text,\n version: text.optional(),\n workflowFn: text.optional(),\n input: z.unknown().optional(),\n signals: z\n .array(z.object({ name: text, payload: z.unknown().optional() }).strict())\n .max(100)\n .optional(),\n idempotencyKey: text.optional(),\n workflowId: text.max(256).optional(),\n idReusePolicy: z\n .enum(['ALLOW_DUPLICATE', 'ALLOW_DUPLICATE_FAILED_ONLY', 'REJECT_DUPLICATE'])\n .optional(),\n idConflictPolicy: z.enum(['FAIL', 'USE_EXISTING', 'TERMINATE_EXISTING']).optional(),\n summary: z.string().max(200).optional(),\n details: z.string().optional(),\n memo: z.record(z.string(), z.unknown()).optional(),\n startDelay: duration.optional(),\n executionTimeout: duration.optional(),\n runTimeout: duration.optional(),\n workflowTaskTimeout: duration.optional(),\n priority: z.number().int().min(1).max(5).optional(),\n completionCallback: z\n .object({\n url: text.url().refine((url) => /^https?:/.test(url), 'Use an HTTP(S) callback URL'),\n headers: z.record(z.string(), z.string()).optional(),\n signingSecret: z.string().min(16).max(512).optional(),\n })\n .strict()\n .optional(),\n versioningBehavior: z.enum(['PINNED', 'AUTO_UPGRADE']).optional(),\n};\n\n/** Register the SDK's code-first and durable operations, without bypassing gateway RBAC. */\nexport function registerDurableTools(\n server: McpServer,\n ctx: McpContext,\n track: (name: string) => string,\n): void {\n function tool<Shape extends z.ZodRawShape>(\n name: string,\n title: string,\n description: string,\n shape: Shape,\n annotations: ToolAnnotations,\n handler: (args: z.infer<z.ZodObject<Shape>>) => Promise<ToolResult>,\n ): void {\n registerTool(\n server,\n ctx,\n track(name),\n { title, description, inputSchema: shape, annotations },\n async (args) => runTool(ctx, name, () => handler(z.object(shape).strict().parse(args))),\n );\n }\n\n async function request(\n document: string,\n variables: Record<string, unknown>,\n root: string,\n ): Promise<ToolResult> {\n const data = await ctx.gql.workspace.request<Record<string, unknown>>(\n document,\n definedInput(variables),\n );\n return jsonResult(data[root] ?? null);\n }\n\n tool(\n mcpToolName(ctx.productName, 'runs_by_workflow_id'),\n 'Run by Workflow ID',\n 'Read the latest visible run of a workflow ID. firstRunId pins its continue-as-new chain. Requires durable parity.',\n target.shape,\n read,\n (args) => request(ops.RUN_BY_WORKFLOW_ID, args, 'workflowRunByWorkflowId'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_describe'),\n 'Describe Durable Run',\n 'Read execution kind, durable state and determinism status. A workflow-ID target also returns chain metadata.',\n { run },\n read,\n ({ run: ref }) =>\n typeof ref === 'string'\n ? request(ops.DESCRIBE_RUN, { id: ref }, 'workflowRun')\n : request(ops.RUN_BY_WORKFLOW_ID, ref, 'workflowRunByWorkflowId'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_pending'),\n 'Pending Run Work',\n 'Read pending activities, children, timers, buffered signals and the open workflow task. Requires durable parity.',\n { run },\n read,\n async ({ run: ref }) => {\n const byId = typeof ref === 'string';\n const data = await ctx.gql.workspace.request<\n Record<string, { id: string; status: string; pending: unknown } | null>\n >(byId ? ops.RUN_PENDING : ops.RUN_PENDING_BY_WORKFLOW_ID, byId ? { id: ref } : ref);\n const row = data[byId ? 'workflowRun' : 'workflowRunByWorkflowId'];\n return jsonResult(row ? { runId: row.id, status: row.status, pending: row.pending } : null);\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_count'),\n 'Count Runs',\n 'Count visible runs, optionally grouped by up to two columns. No pagination applies. Requires durable parity.',\n {\n filter: z\n .object({\n status: z\n .enum([\n 'CANCELLED',\n 'COMPLETED',\n 'FAILED',\n 'PENDING',\n 'RUNNING',\n 'TERMINATED',\n 'WAITING',\n ])\n .optional(),\n workflowKey: text.optional(),\n nodeId: text.optional(),\n search: z.string().optional(),\n startDate: text.optional(),\n endDate: text.optional(),\n errorType: text.optional(),\n durationMinSeconds: z.number().nonnegative().optional(),\n durationMaxSeconds: z.number().nonnegative().optional(),\n executionKind: z.enum(['GRAPH', 'DURABLE_FN']).optional(),\n businessId: text.optional(),\n firstRunId: text.optional(),\n rootRunId: text.optional(),\n memo: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n .optional(),\n groupBy: z\n .array(z.enum(['STATUS', 'WORKFLOW_KEY', 'EXECUTION_KIND', 'TASK_QUEUE']))\n .max(2)\n .optional(),\n },\n read,\n (args) => request(ops.RUNS_COUNT, args, 'workflowRunsCount'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_history'),\n 'Run History Page',\n 'Read one bounded history page. Pass nextAfter as after; offloaded payload URLs are returned, not fetched.',\n {\n run,\n after: z.number().int().nonnegative().optional(),\n limit: z.number().int().min(1).max(1000).optional(),\n },\n read,\n ({ run: ref, ...options }) =>\n request(\n typeof ref === 'string' ? ops.RUN_HISTORY : ops.RUN_HISTORY_BY_TARGET,\n { ...(typeof ref === 'string' ? { runId: ref } : { target: ref }), ...options },\n 'workflowRunHistory',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_signal'),\n 'Signal Run',\n 'Send a signal, potentially resuming a workflow and external actions. Use an idempotencyKey for safe retries. Gateway execute permission and feature gates apply.',\n { run, name: text, payload: z.unknown().optional(), idempotencyKey: text.optional() },\n destructive,\n ({ run: ref, ...input }) =>\n request(\n typeof ref === 'string' ? ops.SIGNAL_RUN : ops.SIGNAL_RUN_BY_TARGET,\n { ...(typeof ref === 'string' ? { runId: ref } : { target: ref }), ...input },\n 'signalWorkflowRun',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_stack_trace'),\n 'Run Stack Trace',\n 'Read the current replayed stack trace. Enhanced traces and optional metadata describe current execution; metadata and workflow-ID targets require durable parity.',\n { run, enhanced: z.boolean().optional(), metadata: z.boolean().optional() },\n read,\n ({ run: ref, enhanced, metadata }) =>\n request(\n typeof ref !== 'string' || metadata ? ops.RUN_STACK_TRACE_PARITY : ops.RUN_STACK_TRACE,\n {\n ...(typeof ref === 'string' ? { runId: ref } : { target: ref }),\n enhanced,\n ...(metadata ? { metadata } : {}),\n },\n 'workflowRunStackTrace',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_determinism'),\n 'Run Determinism Status',\n 'Read whether workflow tasks keep failing and why, without changing run state.',\n { runId: text },\n read,\n (args) => request(ops.RUN_DETERMINISM_STATUS, args, 'workflowRunDeterminismStatus'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_terminate'),\n 'Terminate Run',\n 'Immediately stop a run without cancellation handlers. This is destructive and requires gateway workflow-run delete permission.',\n { run, reason: z.string().optional() },\n destructive,\n ({ run: ref, reason }) =>\n request(\n typeof ref === 'string' ? ops.TERMINATE_RUN : ops.TERMINATE_RUN_BY_TARGET,\n { ...(typeof ref === 'string' ? { runId: ref } : { target: ref }), reason },\n 'terminateWorkflowRun',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_start'),\n 'Start Durable Workflow',\n 'Start a durable workflow, which may execute external actions. Confirm intent before calling. TERMINATE_EXISTING terminates the open run and uses the separate delete-permission gateway operation. Parity options require durable parity.',\n startShape,\n destructive,\n ({ memo, completionCallback, ...input }) => {\n const terminate = input.idConflictPolicy === 'TERMINATE_EXISTING';\n if (terminate && !input.workflowId)\n throw new McpUserError('TERMINATE_EXISTING requires workflowId');\n const parity =\n Object.keys(input).some(\n (key) =>\n ![\n 'workflowKey',\n 'version',\n 'workflowFn',\n 'input',\n 'signals',\n 'idempotencyKey',\n ].includes(key),\n ) ||\n memo !== undefined ||\n completionCallback !== undefined;\n return request(\n terminate\n ? ops.START_WORKFLOW_TERMINATE_EXISTING\n : parity\n ? ops.START_WORKFLOW_PARITY\n : ops.START_WORKFLOW,\n {\n input: definedInput({\n ...input,\n context: memo,\n completionCallbackUrl: completionCallback?.url,\n completionCallbackHeaders: completionCallback?.headers,\n completionCallbackSigningSecret: completionCallback?.signingSecret,\n }),\n },\n terminate ? 'startWorkflowTerminateExisting' : 'startWorkflow',\n );\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_export'),\n 'Export Workflow',\n 'Read a portable workflow document or generated code with a fidelity report. Returned file URLs are not downloaded.',\n {\n workflowKey: text,\n version: text.optional(),\n format: z.enum(['JSON', 'TYPESCRIPT', 'PYTHON', 'YAML', 'BUNDLE']).optional(),\n options: z\n .object({\n connectionNames: z.boolean().optional(),\n connectionNameMap: z.record(z.string(), z.string()).optional(),\n includeLayout: z.boolean().optional(),\n includePinnedData: z.boolean().optional(),\n })\n .strict()\n .optional(),\n },\n read,\n (args) => request(ops.EXPORT_WORKFLOW, args, 'exportWorkflow'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_interface'),\n 'Workflow Interface',\n 'Read the typed interface of a workflow version; null when none exists.',\n { workflowKey: text, version: text.optional() },\n read,\n (args) => request(ops.WORKFLOW_INTERFACE, args, 'workflowInterface'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_validate'),\n 'Validate Workflow',\n 'Validate definition JSON without saving or executing it. strict adds code-authored IR rules.',\n { definitionJson: json, strict: z.boolean().optional() },\n read,\n (args) => request(ops.VALIDATE_WORKFLOW_DEFINITION, args, 'validateWorkflowDefinition'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_create_version'),\n 'Create Workflow Version',\n 'Add a workflow version without running it. Preserve baseVersion/expectedRevision/editSessionId for optimistic concurrency.',\n {\n workflowKey: text,\n definitionJson: json,\n version: text.optional(),\n description: z.string().optional(),\n alias: text.optional(),\n baseVersion: text.optional(),\n expectedRevision: z.number().int().nonnegative().optional(),\n editSessionId: text.optional(),\n interface: z.unknown().optional(),\n authoring: z.unknown().optional(),\n },\n write,\n ({ workflowKey, ...input }) =>\n request(\n ops.CREATE_WORKFLOW_VERSION,\n { workflowKey, input: definedInput(input) },\n 'createWorkflowVersion',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_import'),\n 'Import Workflow',\n 'Create a DRAFT from exactly one of definitionJson or inline source files. The service validates/builds source; no workflow is started. Never put literal credentials in imported source.',\n {\n name: text,\n definitionJson: json.optional(),\n source: z\n .object({\n format: z.enum(['JSON', 'TYPESCRIPT']),\n files: z.array(z.object({ path: text, content: z.string() }).strict()).min(1),\n connections: z\n .record(z.string(), z.object({ connectionId: text, adapter: text.optional() }).strict())\n .optional(),\n })\n .strict()\n .optional(),\n workflowKey: text.optional(),\n version: text.optional(),\n description: z.string().optional(),\n alias: text.optional(),\n context: z.unknown().optional(),\n tags: z.array(z.string()).optional(),\n tagsV2: z.unknown().optional(),\n icon: z.string().optional(),\n category: z.string().optional(),\n nodeMappings: z.unknown().optional(),\n allowMissingNodes: z.boolean().optional(),\n },\n write,\n (input) => {\n if ((input.definitionJson === undefined) === (input.source === undefined))\n throw new McpUserError('Import requires exactly one of definitionJson or source');\n return request(ops.IMPORT_WORKFLOW, { input: definedInput(input) }, 'importWorkflow');\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_import_template'),\n 'Import Workflow Template',\n 'Import a store template as a DRAFT workflow. This does not purchase a template, activate it or run it.',\n {\n name: text,\n definitionJson: json,\n sourceTemplateId: text,\n sourceTemplateName: z.string().optional(),\n workflowKey: text.optional(),\n description: z.string().optional(),\n category: z.string().optional(),\n icon: z.string().optional(),\n tags: z.array(z.string()).optional(),\n projectId: text.optional(),\n context: z.unknown().optional(),\n },\n write,\n (input) =>\n request(\n ops.IMPORT_WORKFLOW_TEMPLATE,\n { input: definedInput(input) },\n 'importWorkflowTemplate',\n ),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CREATE_SCHEDULED_JOB,\n DELETE_SCHEDULED_JOB,\n GET_SCHEDULED_JOB,\n LIST_SCHEDULED_JOBS,\n UPDATE_SCHEDULED_JOB,\n} from '../operations.js';\nimport { definedInput, runTool, workflowPagination } from './helpers.js';\n\nexport function registerScheduledJobTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_list')),\n {\n title: 'List Scheduled Jobs',\n description: 'List schedules that trigger workflows on a cron or interval.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n enabled: z.boolean().optional().describe('Filter by enabled state'),\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ enabled, workflowKey, limit, offset }) =>\n runTool(ctx, 'scheduled_jobs_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowScheduledJobs: unknown }>(\n LIST_SCHEDULED_JOBS,\n { enabled, workflowKey, pagination: workflowPagination(limit, offset) },\n );\n return jsonResult(data.workflowScheduledJobs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_get')),\n {\n title: 'Get Scheduled Job',\n description: 'Get one scheduled job by ID.',\n annotations: { readOnlyHint: true },\n inputSchema: { jobId: z.string().describe('Scheduled job ID') },\n },\n async ({ jobId }) =>\n runTool(ctx, 'scheduled_jobs_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowScheduledJob: unknown }>(\n GET_SCHEDULED_JOB,\n { jobId },\n );\n return jsonResult(data.workflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_create')),\n {\n title: 'Create Scheduled Job',\n description:\n 'Schedule a workflow. `schedule` is the cron or interval expression the scheduler service evaluates.',\n inputSchema: {\n name: z.string().describe('Job name'),\n workflowKey: z.string().describe('Workflow key to run'),\n version: z.string().describe('Workflow version'),\n schedule: z.string().describe('Cron or interval expression'),\n enabled: z.boolean().optional().describe('Start enabled (default true)'),\n config: z.unknown().optional().describe('Job config as JSON'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async (args) =>\n runTool(ctx, 'scheduled_jobs_create', async () => {\n const data = await ctx.gql.workspace.request<{ createWorkflowScheduledJob: unknown }>(\n CREATE_SCHEDULED_JOB,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createWorkflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_update')),\n {\n title: 'Update Scheduled Job',\n description: 'Update a scheduled job’s name, schedule, config or enabled state.',\n inputSchema: {\n jobId: z.string().describe('Scheduled job ID'),\n name: z.string().optional().describe('Name'),\n schedule: z.string().optional().describe('Cron or interval expression'),\n enabled: z.boolean().optional().describe('Enabled state'),\n config: z.unknown().optional().describe('Job config as JSON'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ jobId, ...input }) =>\n runTool(ctx, 'scheduled_jobs_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateWorkflowScheduledJob: unknown }>(\n UPDATE_SCHEDULED_JOB,\n { jobId, input: definedInput(input) },\n );\n return jsonResult(data.updateWorkflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_delete')),\n {\n title: 'Delete Scheduled Job',\n description: 'Delete a scheduled job permanently.',\n annotations: { destructiveHint: true },\n inputSchema: { jobId: z.string().describe('Scheduled job ID') },\n },\n async ({ jobId }) =>\n runTool(ctx, 'scheduled_jobs_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteWorkflowScheduledJob: unknown }>(\n DELETE_SCHEDULED_JOB,\n { jobId },\n );\n return jsonResult(data.deleteWorkflowScheduledJob);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CREATE_WEBHOOK,\n DELETE_WEBHOOK,\n GET_WEBHOOK,\n LIST_WEBHOOKS,\n TOGGLE_WEBHOOK,\n UPDATE_WEBHOOK,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// Webhooks are EventRegistrations on the deployed schema — there is no\n// `Webhook` type with workflowId/path/method, which is what the pre-BOFF-7084\n// documents assumed.\nconst EventStatusEnum = z.enum(['ACTIVE', 'ARCHIVED', 'DISABLED', 'PAUSED']);\n\nexport function registerWebhookTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_list')),\n {\n title: 'List Webhooks',\n description: 'List event registrations (webhooks) that can trigger workflows.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n status: EventStatusEnum.optional().describe('Filter by status'),\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n },\n },\n async ({ status, workflowKey }) =>\n runTool(ctx, 'webhooks_list', async () => {\n const data = await ctx.gql.workspace.request<{ eventRegistrations: unknown }>(\n LIST_WEBHOOKS,\n { status, workflowKey },\n );\n return jsonResult(data.eventRegistrations);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_get')),\n {\n title: 'Get Webhook',\n description: 'Get one event registration by ID.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Event registration ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'webhooks_get', async () => {\n const data = await ctx.gql.workspace.request<{ eventRegistration: unknown }>(GET_WEBHOOK, {\n id,\n });\n return jsonResult(data.eventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_create')),\n {\n title: 'Create Webhook',\n description:\n 'Register an event source that triggers a workflow. triggerNodeId names the trigger node the event enters at. eventSource and eventType are required by the server schema (CreateEventRegistrationInput!); marking them optional in the tool wrapper produced a \"Field eventSource of required type String! was not provided\" error on every call (BOFF-8204).',\n inputSchema: {\n name: z.string().describe('Registration name'),\n workflowKey: z.string().describe('Workflow key to trigger'),\n triggerNodeId: z.string().describe('Trigger node ID'),\n eventSource: z.string().describe('Event source identifier'),\n eventType: z.string().describe('Event type'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Source-specific config as JSON'),\n payloadMapping: z.unknown().optional().describe('Payload mapping as JSON'),\n validationMethod: z.string().optional().describe('Signature validation method'),\n signatureHeader: z.string().optional().describe('Header carrying the signature'),\n apiKeyHeader: z.string().optional().describe('Header carrying the API key'),\n secretToken: z.string().optional().describe('Shared secret for validation'),\n projectId: z.string().optional().describe('Owning project ID'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async (args) =>\n runTool(ctx, 'webhooks_create', async () => {\n const data = await ctx.gql.workspace.request<{ createEventRegistration: unknown }>(\n CREATE_WEBHOOK,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_update')),\n {\n title: 'Update Webhook',\n description: 'Update an event registration.',\n inputSchema: {\n id: z.string().describe('Event registration ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n status: EventStatusEnum.optional().describe('Status'),\n isActive: z.boolean().optional().describe('Active flag'),\n config: z.unknown().optional().describe('Config as JSON'),\n payloadMapping: z.unknown().optional().describe('Payload mapping as JSON'),\n validationMethod: z.string().optional().describe('Signature validation method'),\n secretToken: z.string().optional().describe('Shared secret'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'webhooks_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateEventRegistration: unknown }>(\n UPDATE_WEBHOOK,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_toggle')),\n {\n title: 'Toggle Webhook',\n description: 'Enable or disable an event registration without deleting it.',\n inputSchema: {\n id: z.string().describe('Event registration ID'),\n isActive: z.boolean().describe('True to enable, false to disable'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id, isActive }) =>\n runTool(ctx, 'webhooks_toggle', async () => {\n const data = await ctx.gql.workspace.request<{ toggleEventRegistration: unknown }>(\n TOGGLE_WEBHOOK,\n { id, isActive },\n );\n return jsonResult(data.toggleEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_delete')),\n {\n title: 'Delete Webhook',\n description: 'Delete an event registration permanently.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Event registration ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'webhooks_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteEventRegistration: unknown }>(\n DELETE_WEBHOOK,\n { id },\n );\n return jsonResult(data.deleteEventRegistration);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n ACTIVATE_WORKFLOW,\n ARCHIVE_WORKFLOW,\n CREATE_WORKFLOW,\n DEACTIVATE_WORKFLOW,\n DELETE_WORKFLOW,\n DUPLICATE_WORKFLOW,\n GET_WORKFLOW,\n GET_WORKFLOW_VERSIONS,\n LIST_WORKFLOWS,\n PUBLISH_WORKFLOW,\n TRIGGER_WORKFLOW,\n UPDATE_WORKFLOW,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\nconst WorkflowStatusEnum = z.enum(['ACTIVE', 'ARCHIVED', 'DEPRECATED', 'DRAFT']);\n\nexport function registerWorkflowTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_list')),\n {\n title: 'List Workflows',\n description:\n 'List FluidGrids workflow definitions with optional filters and pagination. Use latestOnly to collapse a workflowKey to its newest version.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n status: WorkflowStatusEnum.optional().describe('Filter by workflow status'),\n category: z.string().optional().describe('Filter by category'),\n tags: z.array(z.string()).optional().describe('Filter by tags'),\n latestOnly: z\n .boolean()\n .optional()\n .describe('Return only the latest version per workflowKey'),\n limit: z.number().optional().describe('Max results (default 10)'),\n offset: z.number().optional().describe('Offset for pagination (default 0)'),\n },\n },\n async ({ status, category, tags, latestOnly, limit, offset }) =>\n runTool(ctx, 'workflows_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowDefinitions: unknown }>(\n LIST_WORKFLOWS,\n { input: definedInput({ status, category, tags, latestOnly, limit, offset }) },\n );\n return jsonResult(data.workflowDefinitions);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_get')),\n {\n title: 'Get Workflow',\n description:\n 'Get a single workflow definition by id, or by workflowKey (optionally pinned to a version). Without a version the executable version is resolved.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n id: z.string().optional().describe('Workflow definition ID'),\n workflowKey: z.string().optional().describe('Workflow key (alternative to id)'),\n version: z.string().optional().describe('Pin to a specific version'),\n },\n },\n async ({ id, workflowKey, version }) =>\n runTool(ctx, 'workflows_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowDefinition: unknown }>(\n GET_WORKFLOW,\n {\n id,\n workflowKey,\n version,\n },\n );\n return jsonResult(data.workflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_versions')),\n {\n title: 'List Workflow Versions',\n description: 'List every stored version of one workflowKey.',\n annotations: { readOnlyHint: true },\n inputSchema: { workflowKey: z.string().describe('Workflow key') },\n },\n async ({ workflowKey }) =>\n runTool(ctx, 'workflows_versions', async () => {\n const data = await ctx.gql.workspace.request<{ workflowVersions: unknown }>(\n GET_WORKFLOW_VERSIONS,\n { workflowKey },\n );\n return jsonResult(data.workflowVersions);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_create')),\n {\n title: 'Create Workflow',\n description:\n 'Create a workflow definition. definitionJson is the node/edge graph; workflowKey plus version identify it.',\n inputSchema: {\n workflowKey: z.string().describe('Stable key identifying the workflow'),\n name: z.string().describe('Human-readable name'),\n version: z.string().describe('Version string, e.g. \"1.0.0\"'),\n definitionJson: z.unknown().describe('Workflow graph (nodes + edges) as JSON'),\n description: z.string().optional().describe('Description'),\n category: z.string().optional().describe('Category'),\n icon: z.string().optional().describe('Icon identifier'),\n alias: z.string().optional().describe('Alias'),\n projectId: z.string().optional().describe('Owning project ID'),\n context: z.unknown().optional().describe('Context JSON'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async (args) =>\n runTool(ctx, 'workflows_create', async () => {\n const data = await ctx.gql.workspace.request<{ createWorkflowDefinition: unknown }>(\n CREATE_WORKFLOW,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_update')),\n {\n title: 'Update Workflow',\n description:\n 'Update a workflow definition by id. Saving a change to a published workflow forks a new version rather than mutating the active one.',\n inputSchema: {\n id: z.string().describe('Workflow definition ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n definitionJson: z.unknown().optional().describe('Workflow graph as JSON'),\n category: z.string().optional().describe('Category'),\n icon: z.string().optional().describe('Icon identifier'),\n alias: z.string().optional().describe('Alias'),\n context: z.unknown().optional().describe('Context JSON'),\n tags: z.array(z.string()).optional().describe('Tags'),\n version: z.string().optional().describe('Version'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'workflows_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateWorkflowDefinition: unknown }>(\n UPDATE_WORKFLOW,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_delete')),\n {\n title: 'Delete Workflow',\n description:\n 'Delete a workflow by key. Without a version every version of that key is deleted.',\n annotations: { destructiveHint: true },\n inputSchema: {\n workflowKey: z.string().describe('Workflow key'),\n version: z.string().optional().describe('Delete only this version'),\n },\n },\n async ({ workflowKey, version }) =>\n runTool(ctx, 'workflows_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteWorkflowDefinition: unknown }>(\n DELETE_WORKFLOW,\n { workflowKey, version },\n );\n return jsonResult(data.deleteWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_trigger')),\n {\n title: 'Trigger Workflow',\n description:\n 'Start a workflow run. triggerNodeId names the trigger node to start from; stopAtNodeId runs only up to a node (step debugging).',\n inputSchema: {\n workflowKey: z.string().describe('Workflow key'),\n version: z.string().describe('Workflow version'),\n triggerNodeId: z.string().describe('ID of the trigger node to start from'),\n triggerData: z.unknown().optional().describe('Payload passed to the trigger node'),\n context: z.unknown().optional().describe('Run context JSON'),\n stopAtNodeId: z\n .string()\n .optional()\n .describe('Stop after this node and mark the run COMPLETED'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n async (args) =>\n runTool(ctx, 'workflows_trigger', async () => {\n const data = await ctx.gql.workspace.request<{ triggerWorkflow: unknown }>(\n TRIGGER_WORKFLOW,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.triggerWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_publish')),\n {\n title: 'Publish Workflow',\n description: 'Publish a workflow definition, making that version the executable one.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_publish', async () => {\n const data = await ctx.gql.workspace.request<{ publishWorkflow: unknown }>(\n PUBLISH_WORKFLOW,\n { id },\n );\n return jsonResult(data.publishWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_activate')),\n {\n title: 'Activate Workflow',\n description:\n 'Activate a workflow definition. Exactly one version per workflowKey may be ACTIVE.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_activate', async () => {\n const data = await ctx.gql.workspace.request<{ activateWorkflowDefinition: unknown }>(\n ACTIVATE_WORKFLOW,\n { id },\n );\n return jsonResult(data.activateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_deactivate')),\n {\n title: 'Deactivate Workflow',\n description: 'Deactivate a workflow definition so no version of the key is executable.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_deactivate', async () => {\n const data = await ctx.gql.workspace.request<{ deactivateWorkflowDefinition: unknown }>(\n DEACTIVATE_WORKFLOW,\n { id },\n );\n return jsonResult(data.deactivateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_duplicate')),\n {\n title: 'Duplicate Workflow',\n description: 'Copy an existing workflow version to a new workflowKey.',\n inputSchema: {\n workflowKey: z.string().describe('Source workflow key'),\n version: z.string().describe('Source version'),\n newWorkflowKey: z.string().describe('Key for the copy'),\n newVersion: z.string().optional().describe('Version for the copy'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ workflowKey, version, newWorkflowKey, newVersion }) =>\n runTool(ctx, 'workflows_duplicate', async () => {\n const data = await ctx.gql.workspace.request<{ duplicateWorkflow: unknown }>(\n DUPLICATE_WORKFLOW,\n { workflowKey, version, input: definedInput({ newWorkflowKey, newVersion }) },\n );\n return jsonResult(data.duplicateWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_archive')),\n {\n title: 'Archive Workflow',\n description: 'Archive a workflow definition. Reversible: archived workflows still list.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_archive', async () => {\n const data = await ctx.gql.workspace.request<{ archiveWorkflow: unknown }>(\n ARCHIVE_WORKFLOW,\n { id },\n );\n return jsonResult(data.archiveWorkflow);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpPromptName, type McpContext } from '../../core/index.js';\n\n/**\n * FluidGrids MCP prompts — guided multi-step workflows. Names are\n * product-prefixed via mcpPromptName and tracked at function entry.\n */\nexport function registerFluidgridsPrompts(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n const p = ctx.productName;\n const buildName = track(mcpPromptName(p, 'build-workflow'));\n const debugName = track(mcpPromptName(p, 'debug-run'));\n\n // <product>-build-workflow — author, publish and trigger a workflow\n server.registerPrompt(\n buildName,\n {\n title: 'Build a Workflow',\n description:\n 'Guide for authoring a FluidGrids workflow end to end: pick nodes, create the definition, publish a version, then trigger it and confirm the run completes.',\n argsSchema: {\n goal: z.string().optional().describe('What the workflow should do'),\n workflowKey: z.string().optional().describe('Workflow key to use'),\n },\n },\n ({ goal, workflowKey }) => {\n ctx.logger.debug(`Prompt ${buildName} called`, { goal, workflowKey });\n const goalNote = goal\n ? `The workflow should: ${goal}`\n : 'Ask the user what the workflow should do before building anything.';\n const keyNote = workflowKey\n ? `Use the workflowKey \"${workflowKey}\".`\n : 'Choose a stable, descriptive workflowKey and confirm it with the user.';\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Build a FluidGrids workflow.\n\n${goalNote}\n${keyNote}\n\nFollow this order and stop if a step fails:\n\n1. \\`${p}_nodes_list\\` — find the node types you need. Use \\`${p}_nodes_get\\` to read a\n node's input fields before wiring it; do not guess field names.\n2. \\`${p}_workflows_create\\` — build \\`definitionJson\\` as a graph of nodes and edges.\n Exactly one trigger node. Note its node id: triggering needs it.\n3. \\`${p}_workflows_publish\\` then \\`${p}_workflows_activate\\` — only an active version\n is executable, and only one version per key may be ACTIVE.\n4. \\`${p}_workflows_trigger\\` — pass \\`triggerNodeId\\` and any \\`triggerData\\`.\n5. \\`${p}_runs_get\\` — poll until status is terminal (COMPLETED, FAILED, CANCELLED or\n TERMINATED). Statuses are UPPERCASE.\n6. If it did not complete, run \\`${p}_debug-run\\` on the run id.\n\nIf the workflow needs credentials, create them with \\`${p}_credentials_create\\` and\nverify with \\`${p}_credentials_test\\` BEFORE triggering — a missing connection fails\nthe run at the node, not at save time.`,\n },\n },\n ],\n };\n },\n );\n\n // <product>-debug-run — diagnose a failed run\n server.registerPrompt(\n debugName,\n {\n title: 'Debug a Run',\n description:\n 'Guide for diagnosing a FluidGrids run that failed or stalled: read node state, read the log, then retry the failing node or fix the definition.',\n argsSchema: { runId: z.string().optional().describe('Run ID to diagnose') },\n },\n ({ runId }) => {\n ctx.logger.debug(`Prompt ${debugName} called`, { runId });\n const runNote = runId\n ? `Diagnose run \"${runId}\".`\n : `Ask for the run id, or find it with \\`${p}_runs_list\\` filtered to status FAILED.`;\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Diagnose a FluidGrids run.\n\n${runNote}\n\n1. \\`${p}_runs_get\\` — read the run and its per-node state. Identify the FIRST node that\n did not succeed; later failures are usually consequences of it.\n2. \\`${p}_runs_logs\\` — read that node's log with \\`nodeId\\` set, \\`minLevel\\` ERROR first,\n then widen to WARN/INFO if the error alone is not conclusive.\n3. Classify before acting:\n - credential/auth error -> \\`${p}_credentials_test\\` the connection the node uses\n - bad input -> compare against \\`${p}_nodes_get\\` input fields for that node type\n - transient/upstream -> \\`${p}_runs_retry_node\\` is appropriate\n - wrong graph -> fix \\`definitionJson\\` via \\`${p}_workflows_update\\` (this forks a new\n version), then publish, activate and trigger again\n4. Only retry once you know which class it is. Retrying a bad definition just\n reproduces the failure.\n\nA run stuck in WAITING is not failed — it is blocked on a Wait node. Resume it with\n\\`${p}_runs_resume\\` and the payload it expects.`,\n },\n },\n ],\n };\n },\n );\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResourceUri, type McpContext } from '../../core/index.js';\nimport { LIST_NODES } from './operations.js';\nimport { safeErrorMessage } from './tools/helpers.js';\n\n/**\n * Read-only FluidGrids MCP resources. URIs are product-prefixed via\n * mcpResourceUri so they don't collide when multiple MCP servers run side by\n * side. Each is tracked at function entry so the shell manifest reflects what\n * was registered even though registration is imperative.\n */\nexport function registerFluidgridsResources(\n server: McpServer,\n ctx: McpContext,\n track: (uri: string) => string,\n): void {\n const schemaUri = track(mcpResourceUri(ctx.productName, 'schema'));\n const nodesUri = track(mcpResourceUri(ctx.productName, 'nodes'));\n\n // <product>://schema — domain overview\n server.registerResource(\n 'fluidgrids-schema',\n schemaUri,\n {\n title: 'FluidGrids Domain Schema',\n description:\n 'Overview of the FluidGrids workflow-automation domain — entities, enums, and the per-entity tool surface.',\n mimeType: 'text/plain',\n },\n async () => {\n ctx.logger.debug(`Resource ${schemaUri} requested`);\n const schema = `# FluidGrids Domain (Overview)\n\nVisual workflow automation. A workflow is a graph of nodes; running one produces a run.\n\n## Core entities\n- WorkflowDefinition — identified by (workflowKey, version). Many versions per key;\n at most ONE is ACTIVE. Saving over a published version forks a new version.\n- WorkflowRun — one execution. Has per-node state and a log stream.\n- NodeEndpointConfig — an available node type at a version (BUILTIN | CUSTOM | STORE).\n- Connection — a stored credential against a Provider. Secrets live in the vault.\n- EventRegistration — an event source (webhook) that triggers a workflow.\n- ScheduledJob — a cron/interval schedule that triggers a workflow.\n\n## Enums\n- WorkflowStatus: ACTIVE | ARCHIVED | DEPRECATED | DRAFT\n- RunStatus: PENDING | RUNNING | WAITING | COMPLETED | FAILED | CANCELLED | TERMINATED\n (UPPERCASE on the wire — comparing lowercase is a known source of hangs)\n- RunLogLevel: DEBUG | INFO | WARN | ERROR\n- PublishType: BUILTIN | CUSTOM | STORE\n- NodeConfigStatus: AVAILABLE | DEPRECATED | DISABLED\n- EventStatus: ACTIVE | PAUSED | DISABLED | ARCHIVED\n\n## Typical sequence\n1. ${ctx.productName}_nodes_list — see what nodes exist\n2. ${ctx.productName}_workflows_create — create a definition with a definitionJson graph\n3. ${ctx.productName}_workflows_publish / _activate — make a version executable\n4. ${ctx.productName}_workflows_trigger — start a run\n5. ${ctx.productName}_runs_get / _runs_logs — follow it to a terminal status\n\n## Tier\nEvery tool here is workspace tier and needs a workspace context. Sign in and\nselect a workspace with the auth tools first.\n`;\n return { contents: [{ uri: schemaUri, mimeType: 'text/plain', text: schema }] };\n },\n );\n\n // <product>://nodes — live node catalogue\n server.registerResource(\n 'fluidgrids-nodes',\n nodesUri,\n {\n title: 'FluidGrids Node Catalogue',\n description:\n 'The node types currently available to build workflows with, read live from the node endpoint config registry.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${nodesUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfigs: unknown }>(LIST_NODES, {\n status: 'AVAILABLE',\n });\n return {\n contents: [\n {\n uri: nodesUri,\n mimeType: 'application/json',\n text: JSON.stringify(data.nodeEndpointConfigs, null, 2),\n },\n ],\n };\n } catch (error) {\n // Resources must not throw: an unauthenticated client reading this\n // should see why, not an opaque transport failure.\n const message = safeErrorMessage(error);\n ctx.logger.error('fluidgrids nodes resource failed', { error: message });\n return {\n contents: [\n {\n uri: nodesUri,\n mimeType: 'application/json',\n text: JSON.stringify(\n {\n error: message,\n hint: 'Sign in and select a workspace first — the node registry is workspace-scoped.',\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n },\n );\n}\n","/**\n * FluidGrids module (BOFF-7088) — the workflow-automation surface of the\n * FluidGrids product: workflows, runs, nodes, credentials, webhooks, scheduled\n * jobs, workflow variables and pinned data, plus read-only dashboard/usage/\n * search/config, run inspection, data tables and static data.\n *\n * Before this module the fluidgrids-mcp shell mounted only generic platform\n * modules (and, by copy-paste, `vibecontrols`), so an MCP client talking to\n * FluidGrids had 600+ tools and not one that could touch a workflow.\n *\n * Every GraphQL document lives in ./operations.ts, ported from `@fluidgrids/sdk`\n * where each one is validated against vendored snapshots of the deployed\n * supergraphs in CI. All of them are workspace tier.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerCredentialTools } from './tools/credentials.js';\nimport { registerDataTools } from './tools/data.js';\nimport { registerInsightTools } from './tools/insights.js';\nimport { registerInspectTools } from './tools/inspect.js';\nimport { registerNodeTools } from './tools/nodes.js';\nimport { registerRunTools } from './tools/runs.js';\nimport { registerDurableTools } from './tools/durable.js';\nimport { registerScheduledJobTools } from './tools/scheduled-jobs.js';\nimport { registerWebhookTools } from './tools/webhooks.js';\nimport { registerWorkflowTools } from './tools/workflows.js';\nimport { registerFluidgridsPrompts } from './prompts.js';\nimport { registerFluidgridsResources } from './resources.js';\n\nconst fluidgridsModule: McpModule = {\n id: 'fluidgrids',\n version: '0.0.1',\n displayName: 'FluidGrids',\n capabilities: { tools: {}, resources: {}, prompts: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const resources: string[] = [];\n const prompts: string[] = [];\n\n const trackTool = (n: string): string => {\n tools.push(n);\n return n;\n };\n const trackResource = (uri: string): string => {\n resources.push(uri);\n return uri;\n };\n const trackPrompt = (n: string): string => {\n prompts.push(n);\n return n;\n };\n\n registerWorkflowTools(server, ctx, trackTool);\n registerRunTools(server, ctx, trackTool);\n registerDurableTools(server, ctx, trackTool);\n registerNodeTools(server, ctx, trackTool);\n registerCredentialTools(server, ctx, trackTool);\n registerWebhookTools(server, ctx, trackTool);\n registerScheduledJobTools(server, ctx, trackTool);\n registerInsightTools(server, ctx, trackTool);\n registerInspectTools(server, ctx, trackTool);\n registerDataTools(server, ctx, trackTool);\n\n registerFluidgridsResources(server, ctx, trackResource);\n registerFluidgridsPrompts(server, ctx, trackPrompt);\n\n return { tools, resources, prompts };\n },\n};\n\nexport default fluidgridsModule;\n"],"mappings":";;;;;AACA,MAAMA,oBAAkB;AACxB,MAAMC,eAAa;;;;;AAKnB,MAAM,gBAAgB,GAAGA,aAAW;;;;AAIpC,MAAM,iBAAiB;;;;;;;AAQvB,MAAa,kBAAkB;;;;;;;;;;AAU/B,MAAa,kBAAkB;;;mCAGID,kBAAgB;;;;;AAKnD,MAAa,2BAA2B;;yEAEiCA,kBAAgB;;;AAGzF,MAAa,0BAA0B;;;mCAGJA,kBAAgB;;;;AAInD,MAAa,+BAA+B;;;;;;;;AAQ5C,MAAa,qBAAqB;;;;;A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B,MAAM,YAAsB,CAAC;EAC7B,MAAM,UAAoB,CAAC;EAE3B,MAAM,aAAa,MAAsB;GACvC,MAAM,KAAK,CAAC;GACZ,OAAO;EACT;EACA,MAAM,iBAAiB,QAAwB;GAC7C,UAAU,KAAK,GAAG;GAClB,OAAO;EACT;EACA,MAAM,eAAe,MAAsB;GACzC,QAAQ,KAAK,CAAC;GACd,OAAO;EACT;EAEA,sBAAsB,QAAQ,KAAK,SAAS;EAC5C,iBAAiB,QAAQ,KAAK,SAAS;EACvC,qBAAqB,QAAQ,KAAK,SAAS;EAC3C,kBAAkB,QAAQ,KAAK,SAAS;EACxC,wBAAwB,QAAQ,KAAK,SAAS;EAC9C,qBAAqB,QAAQ,KAAK,SAAS;EAC3C,0BAA0B,QAAQ,KAAK,SAAS;EAChD,qBAAqB,QAAQ,KAAK,SAAS;EAC3C,qBAAqB,QAAQ,KAAK,SAAS;EAC3C,kBAAkB,QAAQ,KAAK,SAAS;EAExC,4BAA4B,QAAQ,KAAK,aAAa;EACtD,0BAA0B,QAAQ,KAAK,WAAW;EAElD,OAAO;GAAE;GAAO;GAAW;EAAQ;CACrC;AACF"}
1
+ {"version":3,"file":"index.js","names":["WORKFLOW_FIELDS","RUN_FIELDS","text","ops.LIST_WORKFLOW_VARIABLES","ops.GET_WORKFLOW_VARIABLE","ops.CREATE_WORKFLOW_VARIABLE","ops.UPDATE_WORKFLOW_VARIABLE","ops.DELETE_WORKFLOW_VARIABLE","ops.LIST_DATA_TABLES","ops.GET_DATA_TABLE","ops.QUERY_DATA_TABLE_ROWS","ops.GET_WORKFLOW_STATIC_DATA","ops.LIST_WORKFLOW_STATIC_DATA","ops.PIN_NODE_DATA","ops.UNPIN_NODE_DATA","text","ops.GET_WORKFLOW_SUMMARY","ops.DIFF_WORKFLOW_VERSIONS","ops.RESTORE_WORKFLOW_VERSION","ops.GET_RUN_HIERARCHY","ops.LIST_NODE_STATES","ops.GET_NODE_STATE","ops.CAN_RUN_FROM_NODE","ops.LIST_CUSTOM_NODES","ops.GET_NODE_MANIFEST","ops.GET_NODE_USAGE_STATUS","ops.LIST_OPERATION_CONFIGS","ops.GET_OPERATION_CONFIG","ops.LIST_NODE_INSTALLATIONS","ops.LIST_WEBHOOK_DELIVERIES","ops.LIST_ALL_WEBHOOK_DELIVERIES","ops.LIST_WEBHOOK_EVENT_FILTERS","ops.GET_SCHEDULER_STATUS","ops.RESTORE_SCHEDULED_JOB","ops.GET_ERROR_ANALYTICS","ops.GET_USAGE_TIME_SERIES","ops.GET_DETAILED_NODE_USAGE","ops.GET_WORKFLOW_USAGE_SUMMARY","ops.LIST_PENDING_TOOL_APPROVALS","ops.GET_TOOL_APPROVAL_REQUEST","ops.LIST_LOG_STREAM_DESTINATIONS","ops.GET_LOG_STREAM_DESTINATION","ops.LIST_SECRETS_PROVIDER_CONFIGS","ops.RUN_BY_WORKFLOW_ID","ops.DESCRIBE_RUN","ops.RUN_PENDING","ops.RUN_PENDING_BY_WORKFLOW_ID","ops.RUNS_COUNT","ops.RUN_HISTORY","ops.RUN_HISTORY_BY_TARGET","ops.SIGNAL_RUN","ops.SIGNAL_RUN_BY_TARGET","ops.RUN_STACK_TRACE_PARITY","ops.RUN_STACK_TRACE","ops.RUN_DETERMINISM_STATUS","ops.TERMINATE_RUN","ops.TERMINATE_RUN_BY_TARGET","ops.START_WORKFLOW_TERMINATE_EXISTING","ops.START_WORKFLOW_PARITY","ops.START_WORKFLOW","ops.EXPORT_WORKFLOW","ops.WORKFLOW_INTERFACE","ops.VALIDATE_WORKFLOW_DEFINITION","ops.CREATE_WORKFLOW_VERSION","ops.IMPORT_WORKFLOW","ops.IMPORT_WORKFLOW_TEMPLATE"],"sources":["../../../src/modules/fluidgrids/durable-operations.ts","../../../src/modules/fluidgrids/extended-operations.ts","../../../src/modules/fluidgrids/operations.ts","../../../src/modules/fluidgrids/tools/helpers.ts","../../../src/modules/fluidgrids/tools/credentials.ts","../../../src/modules/fluidgrids/tools/data.ts","../../../src/modules/fluidgrids/tools/insights.ts","../../../src/modules/fluidgrids/tools/inspect.ts","../../../src/modules/fluidgrids/tools/nodes.ts","../../../src/modules/fluidgrids/tools/runs.ts","../../../src/modules/fluidgrids/tools/durable.ts","../../../src/modules/fluidgrids/tools/scheduled-jobs.ts","../../../src/modules/fluidgrids/tools/webhooks.ts","../../../src/modules/fluidgrids/tools/workflows.ts","../../../src/modules/fluidgrids/prompts.ts","../../../src/modules/fluidgrids/resources.ts","../../../src/modules/fluidgrids/index.ts"],"sourcesContent":["/** Code-first and durable-run documents, matching sdk-libs-node's FluidGrids contract. */\nconst WORKFLOW_FIELDS = `id workflowKey name description version status category tags icon isActive totalVersions createdAt updatedAt`;\nconst RUN_FIELDS = `\n id workflowId workflowKey version status startedAt completedAt duration errorMessage\n executionKind workflowFn taskQueue buildId historyLength parentClosePolicy cancelRequestedAt\n determinism { failing cause attempts since lastFailureSeq message }\n`;\nconst PARITY_FIELDS = `${RUN_FIELDS}\n businessId runAttempt firstRunId continuedFromRunId continuedToRunId priority\n summary details currentDetails memo startDelayUntil runTimeoutAt executionTimeoutAt\n`;\nconst PENDING_FIELDS = `\n activities { activityId activityType state attempt maxAttempts scheduledAt lastStartedAt\n lastHeartbeatAt heartbeatDetails lastFailure nextAttemptAt summary }\n children { runId workflowKey version status startedAt }\n timers { timerId fireAt summary }\n bufferedSignals workflowTask { state attempt startedAt failureCause }\n`;\n\nexport const EXPORT_WORKFLOW = `\n query FluidgridsExportWorkflow($workflowKey: String!, $version: String, $format: WorkflowExportFormat, $options: ExportOptionsInput) {\n exportWorkflow(workflowKey: $workflowKey, version: $version, format: $format, options: $options) {\n format schemaVersion exportedAt workflowKey version name description definitionJson context tags icon category\n nodeReferences { nodeId nodeType nodeVersion }\n exportFormat files { path contentType content url }\n fidelity { level items { nodeId path kind detail } } irHash\n }\n }\n`;\nexport const IMPORT_WORKFLOW = `\n mutation FluidgridsImportWorkflow($input: ImportWorkflowInput!) {\n importWorkflow(input: $input) {\n success message workflow { ${WORKFLOW_FIELDS} }\n validation { valid errors warnings missingNodes { nodeId nodeType nodeVersion } }\n }\n }\n`;\nexport const IMPORT_WORKFLOW_TEMPLATE = `\n mutation FluidgridsImportWorkflowTemplate($input: ImportWorkflowTemplateInput!) {\n importWorkflowTemplate(input: $input) { success message workflow { ${WORKFLOW_FIELDS} } }\n }\n`;\nexport const CREATE_WORKFLOW_VERSION = `\n mutation FluidgridsCreateWorkflowVersion($workflowKey: String!, $input: CreateWorkflowVersionInput!) {\n createWorkflowVersion(workflowKey: $workflowKey, input: $input) {\n success message workflow { ${WORKFLOW_FIELDS} }\n }\n }\n`;\nexport const VALIDATE_WORKFLOW_DEFINITION = `\n query FluidgridsValidateWorkflowDefinition($definitionJson: JSON!, $strict: Boolean) {\n validateWorkflowDefinition(definitionJson: $definitionJson, strict: $strict) {\n valid errors { code message nodeId path } warnings { code message nodeId path }\n schemaVersion irHash taskQueues\n }\n }\n`;\nexport const WORKFLOW_INTERFACE = `\n query FluidgridsWorkflowInterface($workflowKey: String!, $version: String) {\n workflowInterface(workflowKey: $workflowKey, version: $version)\n }\n`;\nexport const START_WORKFLOW = `\n mutation FluidgridsStartWorkflow($input: StartWorkflowInput!) {\n startWorkflow(input: $input) { run { ${RUN_FIELDS} } existing }\n }\n`;\nexport const START_WORKFLOW_PARITY = `\n mutation FluidgridsStartWorkflowParity($input: StartWorkflowInput!) {\n startWorkflow(input: $input) { run { ${PARITY_FIELDS} } existing }\n }\n`;\nexport const START_WORKFLOW_TERMINATE_EXISTING = `\n mutation FluidgridsStartWorkflowTerminateExisting($input: StartWorkflowInput!) {\n startWorkflowTerminateExisting(input: $input) { run { ${PARITY_FIELDS} } existing }\n }\n`;\nexport const DESCRIBE_RUN = `\n query FluidgridsDescribeRun($id: ID!) { workflowRun(id: $id) { ${RUN_FIELDS} } }\n`;\nexport const RUN_BY_WORKFLOW_ID = `\n query FluidgridsRunByWorkflowId($workflowKey: String!, $workflowId: String!, $firstRunId: ID) {\n workflowRunByWorkflowId(workflowKey: $workflowKey, workflowId: $workflowId, firstRunId: $firstRunId) { ${PARITY_FIELDS} }\n }\n`;\nexport const RUN_PENDING = `\n query FluidgridsRunPending($id: ID!) { workflowRun(id: $id) { id status pending { ${PENDING_FIELDS} } } }\n`;\nexport const RUN_PENDING_BY_WORKFLOW_ID = `\n query FluidgridsRunPendingByWorkflowId($workflowKey: String!, $workflowId: String!, $firstRunId: ID) {\n workflowRunByWorkflowId(workflowKey: $workflowKey, workflowId: $workflowId, firstRunId: $firstRunId) { id status pending { ${PENDING_FIELDS} } }\n }\n`;\nexport const RUNS_COUNT = `\n query FluidgridsRunsCount($filter: ListWorkflowRunsInput, $groupBy: [RunGroupBy!]) {\n workflowRunsCount(filter: $filter, groupBy: $groupBy) { total groups { key values count } groupsTruncated }\n }\n`;\nconst HISTORY_FIELDS = `events { runId seq type taskId payload payloadUrl createdAt } nextAfter hasMore historyLength historyBytes`;\nexport const RUN_HISTORY = `\n query FluidgridsRunHistory($runId: ID!, $after: Int, $limit: Int) {\n workflowRunHistory(runId: $runId, after: $after, limit: $limit) { ${HISTORY_FIELDS} }\n }\n`;\nexport const RUN_HISTORY_BY_TARGET = `\n query FluidgridsRunHistoryByTarget($target: RunTargetInput!, $after: Int, $limit: Int) {\n workflowRunHistory(target: $target, after: $after, limit: $limit) { ${HISTORY_FIELDS} }\n }\n`;\nconst SIGNAL_FIELDS = `accepted delivered buffered forwardedToRunId seq duplicate`;\nexport const SIGNAL_RUN = `\n mutation FluidgridsSignalRun($runId: ID!, $name: String!, $payload: JSON, $idempotencyKey: String) {\n signalWorkflowRun(runId: $runId, name: $name, payload: $payload, idempotencyKey: $idempotencyKey) { ${SIGNAL_FIELDS} }\n }\n`;\nexport const SIGNAL_RUN_BY_TARGET = `\n mutation FluidgridsSignalRunByTarget($target: RunTargetInput!, $name: String!, $payload: JSON, $idempotencyKey: String) {\n signalWorkflowRun(target: $target, name: $name, payload: $payload, idempotencyKey: $idempotencyKey) { ${SIGNAL_FIELDS} }\n }\n`;\nexport const RUN_STACK_TRACE = `\n query FluidgridsRunStackTrace($runId: ID!, $enhanced: Boolean) {\n workflowRunStackTrace(runId: $runId, enhanced: $enhanced) { trace enhanced }\n }\n`;\nexport const RUN_STACK_TRACE_PARITY = `\n query FluidgridsRunStackTraceParity($runId: ID, $target: RunTargetInput, $enhanced: Boolean, $metadata: Boolean) {\n workflowRunStackTrace(runId: $runId, target: $target, enhanced: $enhanced, metadata: $metadata) {\n trace enhanced metadata { definition currentDetails }\n }\n }\n`;\nexport const RUN_DETERMINISM_STATUS = `\n query FluidgridsRunDeterminismStatus($runId: ID!) {\n workflowRunDeterminismStatus(runId: $runId) { failing cause attempts since lastFailureSeq message }\n }\n`;\nexport const TERMINATE_RUN = `\n mutation FluidgridsTerminateRun($runId: ID!, $reason: String) {\n terminateWorkflowRun(runId: $runId, reason: $reason) { id status completedAt errorMessage }\n }\n`;\nexport const TERMINATE_RUN_BY_TARGET = `\n mutation FluidgridsTerminateRunByTarget($target: RunTargetInput!, $reason: String) {\n terminateWorkflowRun(target: $target, reason: $reason) { id status completedAt errorMessage }\n }\n`;\n","/**\n * FluidGrids documents for the operations sdk-libs-node added in its\n * 2026-11-02 wave that the MCP exposes (BOFF-10887): run inspection, workflow\n * version summaries, the node catalog, insights, webhook deliveries, tool\n * approvals, log streams, secrets providers, variables, data tables, static\n * data and pinned data.\n *\n * Every document is copied from sdk-libs-node `src/modules/fluidgrids/operations.ts`\n * with the same operation name, so a document here and its SDK twin stay easy to\n * compare. The SDK validates them against the production supergraph every night\n * (Operation Conformance); tests/unit/platform-supergraph-contract.test.ts\n * validates them here. All of them are workspace tier.\n *\n * The SDK operations the MCP does not expose (and why) are listed in\n * .parity-allowlist.yaml.\n */\n\nconst WORKFLOW_FIELDS = `\n id workflowKey name description version status category tags icon isActive\n totalVersions projectId createdAt updatedAt\n`;\n\nconst RUN_FIELDS = `\n id workflowId workflowKey version status mode startedAt completedAt duration\n triggeredById triggerNodeId errorMessage errorType progress totalNodes\n completedNodes failedNodes skippedNodes createdAt\n`;\n\nconst NODE_STATE_FIELDS = `\n id nodeId nodeType nodeVersion status error errorType attemptCount startTime endTime duration\n output\n`;\n\nconst NODE_STATE_DETAIL_FIELDS = `\n ${NODE_STATE_FIELDS} runId inputArgs instanceKey childRunId resumeTime reusedFromRunId\n usedPinnedData\n`;\n\n/** One run in the sub-workflow tree: where it sits and which node of its parent started it. */\nconst RUN_HIERARCHY_NODE_FIELDS = `depth parentNodeId run { ${RUN_FIELDS} }`;\n\n/**\n * A document cannot recurse, so six levels of sub-workflow runs are spelled\n * out: depth 9 of the gateways' 10. A run nested deeper is cut off.\n */\nconst RUN_HIERARCHY_CHILDREN = `\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS}\n children { ${RUN_HIERARCHY_NODE_FIELDS} }\n }\n }\n }\n }\n }\n`;\n\nconst NODE_FIELDS = `\n id nodeType nodeVersion name description category icon logo keywords kind author\n publishType status isLatest endpointUrl operations supportsAdapterMode\n adapterOutputType docsUrl createdAt updatedAt\n`;\n\nconst OPERATION_CONFIG_FIELDS = `id nodeType nodeVersion operationName config createdAt updatedAt`;\n\nconst NODE_INSTALLATION_FIELDS = `\n id workspaceId nodeType nodeVersion publishType isEnabled config enabledAt enabledById\n disabledAt updatedAt\n`;\n\n/**\n * One request that reached a webhook's URL. The backend masks credentials in\n * `requestHeaders` as `[REDACTED]`; the body is what the sender sent.\n */\nconst WEBHOOK_DELIVERY_FIELDS = `\n id eventRegistrationId requestHeaders requestBody requestIp validationPassed validationError\n workflowRunId executionStarted executionError responseStatus responseBody receivedAt\n processedAt duration\n`;\n\nconst SCHEDULED_JOB_FIELDS = `\n id name workflowKey version schedule enabled nextRun lastRun config workspaceId createdAt\n updatedAt\n`;\n\nconst TOOL_APPROVAL_REQUEST_FIELDS = `\n id runId nodeId workflowId workflowKey workspaceId status\n toolCalls { callId name argsJson }\n decisions { callId decision reason }\n timeoutAt timeoutAction requestedAt decidedAt decidedBy createdAt updatedAt\n`;\n\n/** `hasSecret` says whether a secret is stored; the secret itself is never returned. */\nconst LOG_STREAM_DESTINATION_FIELDS = `\n id workspaceId name provider endpoint config hasSecret eventFilters isEnabled lastDispatchedAt\n lastDispatchStatus lastDispatchError createdAt updatedAt createdBy updatedBy\n`;\n\n/** Where an external secret store lives; no credential is part of the type. */\nconst SECRETS_PROVIDER_CONFIG_FIELDS = `\n id workspaceId provider awsRegion awsSecretsManagerPrefix azureKeyVaultUri gcpProjectId\n vaultAddress vaultMountPath isEnabled lastTestStatus lastTestMessage lastTestedAt createdAt\n updatedAt\n`;\n\nconst WORKFLOW_STATIC_DATA_FIELDS = `\n id workflowKey scope nodeId data sizeBytes version workspaceId createdAt updatedAt\n`;\n\n/** `value` is null for a secret or externally backed variable. */\nconst WORKFLOW_VARIABLE_FIELDS = `\n id key scope projectId workspaceId description isSecret value externalProvider externalRef\n createdAt createdBy updatedAt updatedBy\n`;\n\nconst DATA_TABLE_FIELDS = `\n id workspaceId name description\n columns { key label type required defaultValue }\n rowCount sizeBytes createdAt createdBy updatedAt updatedBy\n`;\n\nconst DATA_TABLE_ROW_FIELDS = `id tableId data createdAt updatedAt`;\n\nconst PINNED_WORKFLOW_FIELDS = `${WORKFLOW_FIELDS} pinnedNodeData`;\n\n// --- Workflows -----------------------------------------------------------------\n\nexport const GET_WORKFLOW_SUMMARY = `\n query FluidgridsGetWorkflowSummary($workflowKey: String!) {\n workflowSummary(workflowKey: $workflowKey) {\n workflowKey\n totalVersions\n latestVersion\n createdAt\n lastModified\n }\n }\n`;\n\nexport const DIFF_WORKFLOW_VERSIONS = `\n query FluidgridsDiffWorkflowVersions(\n $workflowKey: String!\n $fromVersion: String!\n $toVersion: String!\n ) {\n workflowVersionDiff(\n workflowKey: $workflowKey\n fromVersion: $fromVersion\n toVersion: $toVersion\n ) {\n workflowKey\n fromVersion\n toVersion\n truncated\n entries { path kind before after }\n }\n }\n`;\n\n/** A new DRAFT copied from an old version; the old one is untouched. */\nexport const RESTORE_WORKFLOW_VERSION = `\n mutation FluidgridsRestoreWorkflowVersion($workflowKey: String!, $version: String!) {\n restoreWorkflowVersion(workflowKey: $workflowKey, version: $version) {\n success\n message\n workflow { ${WORKFLOW_FIELDS} }\n }\n }\n`;\n\n// --- Runs ----------------------------------------------------------------------\n\nexport const GET_RUN_HIERARCHY = `\n query FluidgridsGetRunHierarchy($runId: ID!) {\n workflowRunHierarchy(runId: $runId) {\n totalDepth\n root { ${RUN_FIELDS} }\n ${RUN_HIERARCHY_CHILDREN}\n }\n }\n`;\n\nexport const LIST_NODE_STATES = `\n query FluidgridsListNodeStates($runId: String!) {\n nodeStates(runId: $runId) { ${NODE_STATE_FIELDS} }\n }\n`;\n\nexport const GET_NODE_STATE = `\n query FluidgridsGetNodeState($id: ID!) {\n nodeState(id: $id) { ${NODE_STATE_DETAIL_FIELDS} }\n }\n`;\n\n/** The backend's read-only preflight for a run from a node. */\nexport const CAN_RUN_FROM_NODE = `\n query FluidgridsCanRunFromNode($input: RunFromNodeEligibilityInput!) {\n runFromNodeEligibility(input: $input) {\n eligible\n reason\n sourceRunId\n workflowKey\n version\n targetNodeId\n targetStatus\n sourceMode\n ancestorNodeIds\n completedAncestorNodeIds\n blockedNodeIds\n blockers\n }\n }\n`;\n\n// --- Nodes ---------------------------------------------------------------------\n\nexport const LIST_CUSTOM_NODES = `\n query FluidgridsListCustomNodes($pagination: WorkflowPaginationInput) {\n customNodes(pagination: $pagination) {\n items { ${NODE_FIELDS} }\n pagination { page limit total totalPages hasNext hasPrev }\n }\n }\n`;\n\n/** A JSON object assembled from the registry's record; null when there is no such node. */\nexport const GET_NODE_MANIFEST = `\n query FluidgridsGetNodeManifest($nodeType: String!, $version: String!) {\n nodeManifest(nodeType: $nodeType, version: $version)\n }\n`;\n\nexport const GET_NODE_USAGE_STATUS = `\n query FluidgridsGetNodeUsageStatus($nodeType: String!, $nodeVersion: String!) {\n nodeUsageStatus(nodeType: $nodeType, nodeVersion: $nodeVersion) {\n nodeType\n nodeVersion\n isInUse\n workflowCount\n workflows { workflowId workflowKey workflowName }\n }\n }\n`;\n\nexport const LIST_OPERATION_CONFIGS = `\n query FluidgridsListOperationConfigs(\n $nodeType: String\n $nodeVersion: String\n $pagination: WorkflowPaginationInput\n ) {\n operationConfigs(nodeType: $nodeType, nodeVersion: $nodeVersion, pagination: $pagination) {\n configs { ${OPERATION_CONFIG_FIELDS} }\n pagination { total limit offset hasMore }\n }\n }\n`;\n\nexport const GET_OPERATION_CONFIG = `\n query FluidgridsGetOperationConfig(\n $nodeType: String!\n $nodeVersion: String!\n $operationName: String!\n ) {\n operationConfig(nodeType: $nodeType, nodeVersion: $nodeVersion, operationName: $operationName) {\n ${OPERATION_CONFIG_FIELDS}\n }\n }\n`;\n\nexport const LIST_NODE_INSTALLATIONS = `\n query FluidgridsListNodeInstallations {\n workspaceNodeInstallations { ${NODE_INSTALLATION_FIELDS} }\n }\n`;\n\n// --- Webhooks ------------------------------------------------------------------\n\nexport const LIST_WEBHOOK_DELIVERIES = `\n query FluidgridsListWebhookDeliveries($eventRegistrationId: String!, $limit: Int) {\n webhookDeliveryLogs(eventRegistrationId: $eventRegistrationId, limit: $limit) {\n ${WEBHOOK_DELIVERY_FIELDS}\n }\n }\n`;\n\nexport const LIST_ALL_WEBHOOK_DELIVERIES = `\n query FluidgridsListAllWebhookDeliveries($limit: Int, $offset: Int, $validationPassed: Boolean) {\n allWebhookDeliveries(limit: $limit, offset: $offset, validationPassed: $validationPassed) {\n ${WEBHOOK_DELIVERY_FIELDS}\n }\n }\n`;\n\nexport const LIST_WEBHOOK_EVENT_FILTERS = `\n query FluidgridsListWebhookEventFilters($eventRegistrationId: String!) {\n eventFilters(eventRegistrationId: $eventRegistrationId) {\n id\n eventRegistrationId\n filterType\n filterExpression\n isActive\n createdAt\n updatedAt\n }\n }\n`;\n\n// --- Scheduled jobs ------------------------------------------------------------\n\nexport const RESTORE_SCHEDULED_JOB = `\n mutation FluidgridsRestoreScheduledJob($jobId: ID!) {\n restoreScheduledJob(jobId: $jobId) {\n success\n message\n job { ${SCHEDULED_JOB_FIELDS} }\n }\n }\n`;\n\nexport const GET_SCHEDULER_STATUS = `\n query FluidgridsGetSchedulerStatus {\n workflowScheduledJobsStatus\n }\n`;\n\n// --- Insights ------------------------------------------------------------------\n\nexport const GET_ERROR_ANALYTICS = `\n query FluidgridsGetErrorAnalytics($input: ErrorAnalyticsInput) {\n errorAnalytics(input: $input) {\n totalErrors\n errorsByType { errorType count }\n topFailingWorkflows { workflowKey name totalRuns failureCount failureRate }\n topFailingNodes { nodeType totalExecutions failureCount failureRate sampleError }\n trend { date count }\n }\n }\n`;\n\nexport const GET_USAGE_TIME_SERIES = `\n query FluidgridsGetUsageTimeSeries($input: TimeSeriesInput!) {\n usageTimeSeries(input: $input) {\n metric\n granularity\n dataPoints {\n timestamp\n workflowRuns\n successfulRuns\n failedRuns\n cancelledRuns\n nodeExecutions\n averageDuration\n totalDuration\n }\n }\n }\n`;\n\nexport const GET_DETAILED_NODE_USAGE = `\n query FluidgridsGetDetailedNodeUsage($input: DetailedNodeUsageInput!) {\n detailedNodeUsage(input: $input) {\n nodeType\n nodeVersion\n executionCount\n successCount\n failureCount\n skipCount\n totalDuration\n averageDuration\n medianDuration\n minDuration\n maxDuration\n successRate\n lastExecutedAt\n }\n }\n`;\n\nexport const GET_WORKFLOW_USAGE_SUMMARY = `\n query FluidgridsGetWorkflowUsageSummary($input: WorkflowUsageSummaryInput!) {\n workflowUsageSummary(input: $input) {\n period\n totalWorkflowRuns\n totalNodeExecutions\n totalDurationSeconds\n nodeMinutes\n breakdown\n }\n }\n`;\n\n// --- Tool approvals ------------------------------------------------------------\n\nexport const LIST_PENDING_TOOL_APPROVALS = `\n query FluidgridsListPendingToolApprovals($limit: Int, $offset: Int) {\n pendingToolApprovals(limit: $limit, offset: $offset) {\n totalCount\n items { ${TOOL_APPROVAL_REQUEST_FIELDS} }\n }\n }\n`;\n\nexport const GET_TOOL_APPROVAL_REQUEST = `\n query FluidgridsGetToolApprovalRequest($id: ID!) {\n toolApprovalRequest(id: $id) { ${TOOL_APPROVAL_REQUEST_FIELDS} }\n }\n`;\n\n// --- Log streams and secrets providers -----------------------------------------\n\nexport const LIST_LOG_STREAM_DESTINATIONS = `\n query FluidgridsListLogStreamDestinations {\n logStreamDestinations { ${LOG_STREAM_DESTINATION_FIELDS} }\n }\n`;\n\nexport const GET_LOG_STREAM_DESTINATION = `\n query FluidgridsGetLogStreamDestination($id: ID!) {\n logStreamDestination(id: $id) { ${LOG_STREAM_DESTINATION_FIELDS} }\n }\n`;\n\nexport const LIST_SECRETS_PROVIDER_CONFIGS = `\n query FluidgridsListSecretsProviderConfigs {\n secretsProviderConfigs { ${SECRETS_PROVIDER_CONFIG_FIELDS} }\n }\n`;\n\n// --- Variables -----------------------------------------------------------------\n\nexport const LIST_WORKFLOW_VARIABLES = `\n query FluidgridsListWorkflowVariables($projectId: ID, $scope: VariableScope) {\n workflowVariables(projectId: $projectId, scope: $scope) {\n total\n variables { ${WORKFLOW_VARIABLE_FIELDS} }\n }\n }\n`;\n\nexport const GET_WORKFLOW_VARIABLE = `\n query FluidgridsGetWorkflowVariable($id: ID!) {\n workflowVariable(id: $id) { ${WORKFLOW_VARIABLE_FIELDS} }\n }\n`;\n\nexport const CREATE_WORKFLOW_VARIABLE = `\n mutation FluidgridsCreateWorkflowVariable($input: CreateWorkflowVariableInput!) {\n createWorkflowVariable(input: $input) {\n success\n message\n variable { ${WORKFLOW_VARIABLE_FIELDS} }\n }\n }\n`;\n\nexport const UPDATE_WORKFLOW_VARIABLE = `\n mutation FluidgridsUpdateWorkflowVariable($id: ID!, $input: UpdateWorkflowVariableInput!) {\n updateWorkflowVariable(id: $id, input: $input) {\n success\n message\n variable { ${WORKFLOW_VARIABLE_FIELDS} }\n }\n }\n`;\n\nexport const DELETE_WORKFLOW_VARIABLE = `\n mutation FluidgridsDeleteWorkflowVariable($id: ID!) {\n deleteWorkflowVariable(id: $id) {\n success\n message\n }\n }\n`;\n\n// --- Data tables ---------------------------------------------------------------\n\nexport const LIST_DATA_TABLES = `\n query FluidgridsListDataTables($search: String, $limit: Int, $offset: Int) {\n dataTables(search: $search, limit: $limit, offset: $offset) {\n total\n tables { ${DATA_TABLE_FIELDS} }\n }\n }\n`;\n\nexport const GET_DATA_TABLE = `\n query FluidgridsGetDataTable($id: ID!) {\n dataTable(id: $id) { ${DATA_TABLE_FIELDS} }\n }\n`;\n\nexport const QUERY_DATA_TABLE_ROWS = `\n query FluidgridsQueryDataTableRows($input: DataTableRowsQueryInput!) {\n dataTableRows(input: $input) {\n total\n rows { ${DATA_TABLE_ROW_FIELDS} }\n }\n }\n`;\n\n// --- Static data ---------------------------------------------------------------\n\nexport const GET_WORKFLOW_STATIC_DATA = `\n query FluidgridsGetWorkflowStaticData(\n $workflowKey: String!\n $scope: StaticDataScope!\n $nodeId: String\n ) {\n workflowStaticData(workflowKey: $workflowKey, scope: $scope, nodeId: $nodeId) {\n ${WORKFLOW_STATIC_DATA_FIELDS}\n }\n }\n`;\n\nexport const LIST_WORKFLOW_STATIC_DATA = `\n query FluidgridsListWorkflowStaticData($workflowKey: String!) {\n workflowStaticDataList(workflowKey: $workflowKey) { ${WORKFLOW_STATIC_DATA_FIELDS} }\n }\n`;\n\n// --- Pinned data ---------------------------------------------------------------\n\n/** Pins the output a node returns in a TEST run; a PRODUCTION run never uses it. */\nexport const PIN_NODE_DATA = `\n mutation FluidgridsPinNodeData($id: ID!, $nodeId: String!, $data: JSON!) {\n pinNodeData(id: $id, nodeId: $nodeId, data: $data) { ${PINNED_WORKFLOW_FIELDS} }\n }\n`;\n\nexport const UNPIN_NODE_DATA = `\n mutation FluidgridsUnpinNodeData($id: ID!, $nodeId: String!) {\n unpinNodeData(id: $id, nodeId: $nodeId) { ${PINNED_WORKFLOW_FIELDS} }\n }\n`;\n","/**\n * FluidGrids GraphQL operations (BOFF-7088).\n *\n * Ported verbatim from \\`@fluidgrids/sdk\\` (fluidgrids-sdk-node) \\`src/graphql/\\`,\n * which validates every one of these documents against vendored snapshots of the\n * deployed supergraphs in CI. Do not hand-edit a document here without making the\n * same change there -- the SDK is the source of truth and the only place the\n * documents are schema-checked.\n *\n * Every operation below is WORKSPACE tier (\\`ctx.gql.workspace\\`). Authentication,\n * \\`currentUser\\` and \\`health\\` are global tier and are already served by the\n * \\`auth\\` and \\`health\\` modules -- they are deliberately not duplicated here.\n */\n\nexport * from './durable-operations.js';\nexport * from './extended-operations.js';\n\n// Workflows\n// `Query.workflows` also exists on the workspace supergraph, but it belongs to a\n// different subgraph and returns BigConsole's `FluidGridsWorkflow` (linkedDataSinks,\n// externalWorkflowId) — a name collision, not our type. FluidGrids workflows are\n// `workflowDefinition` / `workflowDefinitions`, returning `WorkflowDefinition`.\nexport const LIST_WORKFLOWS = `\n query ListWorkflows($input: ListWorkflowDefinitionsInput!) {\n workflowDefinitions(input: $input) {\n items {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_WORKFLOW = `\n query GetWorkflow($id: ID, $workflowKey: String, $version: String) {\n workflowDefinition(id: $id, workflowKey: $workflowKey, version: $version) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n definitionJson\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey, not workflowId, and returns a plain array.\nexport const GET_WORKFLOW_VERSIONS = `\n query GetWorkflowVersions($workflowKey: String!) {\n workflowVersions(workflowKey: $workflowKey) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Runs\nexport const LIST_RUNS = `\n query ListRuns($input: ListWorkflowRunsInput!) {\n workflowRuns(input: $input) {\n items {\n id\n workflowId\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n triggeredById\n errorMessage\n errorType\n progress\n totalNodes\n completedNodes\n failedNodes\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_RUN = `\n query GetRun($id: ID!) {\n workflowRun(id: $id) {\n id\n workflowId\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n triggeredById\n triggerData\n triggerNodeId\n errorMessage\n errorType\n progress\n totalNodes\n completedNodes\n failedNodes\n skippedNodes\n nodeStates {\n id\n nodeId\n nodeType\n status\n error\n output\n }\n }\n }\n`;\n\nexport const GET_RUN_LOGS = `\n query GetRunLogs(\n $runId: ID!\n $nodeId: String\n $minLevel: RunLogLevel\n $limit: Int\n $after: String\n $search: String\n $includeChildRuns: Boolean\n ) {\n workflowRunLogs(\n runId: $runId\n nodeId: $nodeId\n minLevel: $minLevel\n limit: $limit\n after: $after\n search: $search\n includeChildRuns: $includeChildRuns\n ) {\n lines {\n id\n runId\n nodeId\n level\n message\n timestamp\n data\n attempt\n phase\n stream\n truncated\n }\n hasMore\n nextCursor\n limitReached\n }\n }\n`;\n\n// Nodes\n// `nodes` is not a Query field. Node definitions are `nodeEndpointConfig(s)`, and the\n// response is { configs, pagination } — not { items, total, hasMore }.\nexport const LIST_NODES = `\n query ListNodes(\n $nodeType: String\n $publishType: PublishType\n $status: NodeConfigStatus\n $pagination: WorkflowPaginationInput\n ) {\n nodeEndpointConfigs(\n nodeType: $nodeType\n publishType: $publishType\n status: $status\n pagination: $pagination\n ) {\n configs {\n id\n nodeType\n nodeVersion\n name\n description\n category\n icon\n logo\n keywords\n kind\n author\n publishType\n status\n isLatest\n endpointUrl\n operations\n supportsAdapterMode\n adapterOutputType\n createdAt\n updatedAt\n }\n pagination {\n total\n limit\n offset\n hasMore\n }\n }\n }\n`;\n\n// Keyed by nodeType + nodeVersion, NOT by id.\nexport const GET_NODE = `\n query GetNode($nodeType: String!, $nodeVersion: String!) {\n nodeEndpointConfig(nodeType: $nodeType, nodeVersion: $nodeVersion) {\n id\n nodeType\n nodeVersion\n name\n description\n category\n icon\n logo\n keywords\n kind\n author\n publishType\n status\n isLatest\n endpointUrl\n operations\n supportsAdapterMode\n adapterOutputType\n createdAt\n updatedAt\n healthCheckUrl\n nodeAdapters\n }\n }\n`;\n\n// LIST_NODE_CATEGORIES removed: `nodeCategories` exists on neither supergraph and has\n// no equivalent. Categories are a field on NodeEndpointConfig; derive them client-side.\n// Credentials\n// In FluidGrids a \"credential\" is a CONNECTION (wspace-integrations-svc), and the\n// catalogue of what kinds you can create are PROVIDERS. There is no `credentials`\n// field on either supergraph.\n//\n// ★ getConnection/createConnection/updateConnection/deleteConnection/testConnection\n// ALSO exist on the GLOBAL tier, returning ChannelConnection — a different product,\n// with colliding input type names and different fields. These documents are pinned to\n// the workspace tier, which is the SDK's default endpoint. Do not \"fix\" a failure here\n// by pointing at global; it would parse, execute, and return the wrong product's data.\nexport const LIST_CREDENTIALS = `\n query ListCredentials($filter: ConnectionFilterInput, $pagination: IntegrationsPaginationInput) {\n getConnections(filter: $filter, pagination: $pagination) {\n items {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n category\n authType\n icon\n }\n credentialSource\n externalAccountId\n externalAccountName\n externalAccountEmail\n grantedScopes\n lastUsedAt\n lastHealthCheck\n errorMessage\n createdAt\n updatedAt\n }\n total\n hasMore\n }\n }\n`;\n\nexport const GET_CREDENTIAL = `\n query GetCredential($id: ID!) {\n getConnection(id: $id) {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n description\n category\n authType\n configSchema\n availableScopes\n defaultScopes\n icon\n docsUrl\n }\n config\n metadata\n credentialSource\n externalAccountId\n externalAccountName\n externalAccountEmail\n grantedScopes\n lastUsedAt\n lastHealthCheck\n errorMessage\n workspaceId\n createdAt\n updatedAt\n }\n }\n`;\n\n// Returns a PAGE (ProviderList), not an array — the catalogue defaults to limit 50.\nexport const LIST_CREDENTIAL_TYPES = `\n query ListCredentialTypes($filter: ProviderFilterInput, $pagination: IntegrationsPaginationInput) {\n getProviders(filter: $filter, pagination: $pagination) {\n items {\n id\n key\n name\n description\n category\n authType\n configSchema\n availableScopes\n defaultScopes\n icon\n docsUrl\n isBuiltIn\n isEnabled\n connectionCount\n }\n total\n hasMore\n }\n }\n`;\n\n// Webhooks\n// A FluidGrids webhook is an EVENT REGISTRATION — it binds a workflowKey and a\n// triggerNodeId to a webhookUrl/webhookToken.\n//\n// ★ Query.webhooks ALSO exists and returns type Webhook, but that is a different\n// subgraph's OUTBOUND delivery system (agentIds, retryPolicy, deliveryCount, and a\n// neighbouring webhookExecutions taking CalendarPaginationInput). It has no\n// workflowKey and is not ours. Do not \"fix\" a failure here by switching to it.\nexport const LIST_WEBHOOKS = `\n query ListWebhooks($status: EventStatus, $workflowKey: String) {\n eventRegistrations(status: $status, workflowKey: $workflowKey) {\n id\n name\n description\n workflowKey\n triggerNodeId\n eventSource\n eventType\n status\n isActive\n webhookUrl\n webhookToken\n validationMethod\n signatureHeader\n apiKeyHeader\n payloadMapping\n config\n tags\n totalTriggers\n successfulTriggers\n failedTriggers\n lastTriggeredAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const GET_WEBHOOK = `\n query GetWebhook($id: ID!) {\n eventRegistration(id: $id) {\n id\n name\n description\n workflowKey\n triggerNodeId\n eventSource\n eventType\n status\n isActive\n webhookUrl\n webhookToken\n validationMethod\n signatureHeader\n apiKeyHeader\n payloadMapping\n config\n tags\n totalTriggers\n successfulTriggers\n failedTriggers\n lastTriggeredAt\n createdAt\n updatedAt\n projectId\n workspaceId\n createdById\n }\n }\n`;\n\n// Scheduled Jobs\n// ★ `scheduledJobs` also exists and returns ScheduledJob — the GENERIC platform\n// scheduler (cronExpression, executorType, circuitBreaker, rrule, businessCalendarId).\n// That is a different service. FluidGrids workflow crons are workflowScheduledJob(s),\n// whose type carries workflowKey/schedule/enabled/nextRun.\n// Note the response field is `jobs`, not `items`.\nexport const LIST_SCHEDULED_JOBS = `\n query ListScheduledJobs($enabled: Boolean, $workflowKey: String, $pagination: WorkflowPaginationInput) {\n workflowScheduledJobs(enabled: $enabled, workflowKey: $workflowKey, pagination: $pagination) {\n jobs {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n pagination {\n total\n limit\n offset\n hasMore\n }\n }\n }\n`;\n\n// Argument is `jobId`, not `id`.\nexport const GET_SCHEDULED_JOB = `\n query GetScheduledJob($jobId: ID!) {\n workflowScheduledJob(jobId: $jobId) {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n workspaceId\n }\n }\n`;\n\n// Dashboard\nexport const GET_DASHBOARD_SUMMARY = `\n query DashboardSummary($projectId: String) {\n dashboardSummary(projectId: $projectId) {\n userId\n username\n workflowsCount\n activeWorkflowsCount\n archivedWorkflowsCount\n runsCountTotal\n runsCompletedCount\n runsFailedCount\n runsCancelledCount\n runsPendingCount\n runsRunningCount\n runsWaitingCount\n runsCompletedLast24h\n runsFailedLast24h\n runsCompletedLast7d\n runsFailedLast7d\n runsCompletedLast30d\n runsFailedLast30d\n totalNodesExecutedCount\n workflowSuccessRate\n avgWorkflowExecutionTimeSeconds\n avgNodeExecutionTimeSeconds\n recentRuns {\n id\n workflowKey\n version\n status\n startedAt\n completedAt\n duration\n }\n recentWorkflows {\n workflowKey\n name\n version\n updatedAt\n }\n nodeUsageStats {\n nodeType\n totalExecutions\n successCount\n failureCount\n avgExecutionTime\n }\n }\n }\n`;\n\nexport const GET_USAGE_METRICS = `\n query GetUsageMetrics($input: UsageQueryInput!) {\n usageMetrics(input: $input) {\n period\n workflowMetrics {\n totalRuns\n successfulRuns\n failedRuns\n cancelledRuns\n totalDurationSeconds\n averageDurationSeconds\n minDurationSeconds\n maxDurationSeconds\n medianDurationSeconds\n }\n nodeMetrics {\n totalNodes\n successfulNodes\n failedNodes\n skippedNodes\n totalDurationSeconds\n averageDurationSeconds\n nodeTypeBreakdown\n }\n }\n }\n`;\n\n// Events have no FluidGrids equivalent. `Query.events(calendarId: ID!)` belongs to\n// the calendar service and returns an EventConnection of CalendarEvent. FluidGrids'\n// only event noun is EventRegistration, which `webhooks` already owns.\n// Search\nexport const SEARCH = `\n query Search($input: SearchRequestInput!) {\n search(input: $input) {\n query\n results\n entityCounts\n totalResults\n metadata\n }\n }\n`;\n\nexport const SEARCH_BY_ENTITY_TYPE = `\n query SearchByEntityType($entityType: String!, $query: String!, $filters: SearchFilterInput, $limit: Int, $offset: Int) {\n searchByEntityType(entityType: $entityType, query: $query, filters: $filters, limit: $limit, offset: $offset) {\n query\n results\n entityCounts\n totalResults\n metadata\n }\n }\n`;\n\n// Admin\nexport const GET_SYSTEM_CONFIG = `\n query GetSystemConfig {\n systemConfig {\n version\n revision\n environment\n deploymentType\n hostname\n hostIp\n }\n }\n`;\n\n// Workflows\n// ★★ createWorkflow / updateWorkflow / deleteWorkflow ALL exist and pass schema\n// validation — but they return FluidGridsWorkflow, which is BIGCONSOLE's datasink\n// type (linkedDataSinks, externalWorkflowId), not ours. The FluidGrids workflow CRUD\n// is the *WorkflowDefinition family. This is why \"the operation validates\" is not\n// sufficient evidence: the RETURN TYPE has to be ours too.\nexport const CREATE_WORKFLOW = `\n mutation CreateWorkflow($input: CreateWorkflowDefinitionInput!) {\n createWorkflowDefinition(input: $input) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const UPDATE_WORKFLOW = `\n mutation UpdateWorkflow($id: ID!, $input: UpdateWorkflowDefinitionInput!) {\n updateWorkflowDefinition(id: $id, input: $input) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey (+ optional version), not id.\nexport const DELETE_WORKFLOW = `\n mutation DeleteWorkflow($workflowKey: String!, $version: String) {\n deleteWorkflowDefinition(workflowKey: $workflowKey, version: $version)\n }\n`;\n\n// Everything moves into a single input; there is no `id` argument.\nexport const TRIGGER_WORKFLOW = `\n mutation TriggerWorkflow($input: TriggerWorkflowInput!) {\n triggerWorkflow(input: $input) {\n runId\n status\n workflowKey\n version\n triggerNodeId\n }\n }\n`;\n\n// One argument. There is no changeLog.\nexport const PUBLISH_WORKFLOW = `\n mutation PublishWorkflow($id: ID!) {\n publishWorkflow(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const ACTIVATE_WORKFLOW = `\n mutation ActivateWorkflow($id: ID!) {\n activateWorkflowDefinition(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const DEACTIVATE_WORKFLOW = `\n mutation DeactivateWorkflow($id: ID!) {\n deactivateWorkflowDefinition(id: $id) {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n`;\n\n// Keyed by workflowKey + version, with the new identity in the input.\nexport const DUPLICATE_WORKFLOW = `\n mutation DuplicateWorkflow($workflowKey: String!, $version: String!, $input: DuplicateWorkflowInput!) {\n duplicateWorkflow(workflowKey: $workflowKey, version: $version, input: $input) {\n success\n message\n workflow {\n id\n workflowKey\n name\n description\n version\n status\n category\n tags\n icon\n isActive\n totalVersions\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const ARCHIVE_WORKFLOW = `\n mutation ArchiveWorkflow($id: ID!) {\n archiveWorkflow(id: $id) {\n id\n status\n }\n }\n`;\n\n// Runs\nexport const CANCEL_RUN = `\n mutation CancelRun($id: ID!) {\n cancelWorkflowRun(id: $id) {\n id\n status\n completedAt\n errorMessage\n }\n }\n`;\n\nexport const PAUSE_RUN = `\n mutation PauseRun($id: ID!) {\n pauseWorkflowRun(id: $id) {\n id\n status\n completedAt\n errorMessage\n }\n }\n`;\n\n// resumeWorkflowRun returns ResumeWorkflowResponse (success/message/run), not a run.\nexport const RESUME_RUN = `\n mutation ResumeRun($id: ID!, $payload: JSON) {\n resumeWorkflowRun(id: $id, payload: $payload) {\n success\n message\n resumedFromNodeId\n run {\n id\n status\n completedAt\n errorMessage\n }\n }\n }\n`;\n\n// The deployed resolver signature is `retryNode(id: ID!, nodeId: String!)` where `id` is the\n// NodeState id, not the run id. The tool takes a run id + workflow node id\n// from the caller, looks up the run to find the matching NodeState, and then\n// forwards the NodeState id to the mutation. The return type is a NodeState.\nexport const RETRY_RUN = `\n mutation RetryNode($id: ID!, $nodeId: String!) {\n retryNode(id: $id, nodeId: $nodeId) {\n id\n nodeId\n nodeType\n status\n error\n attemptCount\n }\n }\n`;\n\n// Credentials\n// ★ Creating a credential is a TWO-STEP flow. CreateConnectionInput has no `data`\n// and no `type` — there is no way to post raw secret material here. You create the\n// connection shell against a providerId, then attach the secret with one of the\n// authenticate* mutations below (or reference an existing vault secret at create time\n// via credentialSecretId / managedSecretName / vaultId).\nexport const CREATE_CREDENTIAL = `\n mutation CreateCredential($input: CreateConnectionInput!) {\n createConnection(input: $input) {\n id\n name\n description\n status\n providerId\n provider {\n id\n key\n name\n authType\n }\n credentialSource\n createdAt\n }\n }\n`;\n\nexport const AUTHENTICATE_CREDENTIAL_API_KEY = `\n mutation AuthenticateCredentialApiKey($input: ApiKeyAuthInput!) {\n authenticateWithApiKey(input: $input) {\n id\n name\n status\n grantedScopes\n externalAccountName\n errorMessage\n updatedAt\n }\n }\n`;\n\nexport const AUTHENTICATE_CREDENTIAL_BASIC = `\n mutation AuthenticateCredentialBasic($input: BasicAuthInput!) {\n authenticateWithBasicAuth(input: $input) {\n id\n name\n status\n grantedScopes\n externalAccountName\n errorMessage\n updatedAt\n }\n }\n`;\n\n// UpdateConnectionInput carries only { config, description, name } — secrets are\n// never updated through this path.\nexport const UPDATE_CREDENTIAL = `\n mutation UpdateCredential($id: ID!, $input: UpdateConnectionInput!) {\n updateConnection(id: $id, input: $input) {\n id\n name\n description\n status\n config\n updatedAt\n }\n }\n`;\n\nexport const DELETE_CREDENTIAL = `\n mutation DeleteCredential($id: ID!, $deleteVaultSecret: Boolean) {\n deleteConnection(id: $id, deleteVaultSecret: $deleteVaultSecret)\n }\n`;\n\n// Argument is `connectionId`, not `id`.\nexport const TEST_CREDENTIAL = `\n mutation TestCredential($connectionId: ID!) {\n testConnection(connectionId: $connectionId) {\n success\n message\n latencyMs\n }\n }\n`;\n\n// Webhooks\nexport const CREATE_WEBHOOK = `\n mutation CreateWebhook($input: CreateEventRegistrationInput!) {\n createEventRegistration(input: $input) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n createdAt\n }\n }\n`;\n\n// ★ The previous UPDATE_WEBHOOK targeted `updateWebhook(id, input): Webhook!`, which\n// EXISTS and therefore passed schema validation — but returns the other subgraph's\n// Webhook, not our EventRegistration. Validation passing is not the same as being\n// correct; the return type has to be ours too. Same for the old deleteWebhook.\nexport const UPDATE_WEBHOOK = `\n mutation UpdateWebhook($id: ID!, $input: UpdateEventRegistrationInput!) {\n updateEventRegistration(id: $id, input: $input) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n }\n }\n`;\n\nexport const DELETE_WEBHOOK = `\n mutation DeleteWebhook($id: ID!) {\n deleteEventRegistration(id: $id)\n }\n`;\n\n// activate and deactivate are the SAME mutation with a flag.\nexport const TOGGLE_WEBHOOK = `\n mutation ToggleWebhook($id: ID!, $isActive: Boolean!) {\n toggleEventRegistration(id: $id, isActive: $isActive) {\n id\n name\n workflowKey\n triggerNodeId\n isActive\n status\n webhookUrl\n webhookToken\n updatedAt\n }\n }\n`;\n\n// DEACTIVATE_WEBHOOK removed — see TOGGLE_WEBHOOK above.\n// Scheduled Jobs\nexport const CREATE_SCHEDULED_JOB = `\n mutation CreateScheduledJob($input: ScheduledJobInput!) {\n createWorkflowScheduledJob(input: $input) {\n success\n message\n job {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const UPDATE_SCHEDULED_JOB = `\n mutation UpdateScheduledJob($jobId: ID!, $input: WorkflowUpdateScheduledJobInput!) {\n updateWorkflowScheduledJob(jobId: $jobId, input: $input) {\n success\n message\n job {\n id\n name\n workflowKey\n version\n schedule\n enabled\n nextRun\n lastRun\n config\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const DELETE_SCHEDULED_JOB = `\n mutation DeleteScheduledJob($jobId: ID!) {\n deleteWorkflowScheduledJob(jobId: $jobId) {\n success\n message\n }\n }\n`;\n","/**\n * Internal helpers shared by the FluidGrids tool files.\n *\n * These keep each registration explicit (literal product-prefixed names via\n * mcpToolName, typed inputSchema, jsonResult/errorResult) while factoring out\n * the repetitive try/catch + structured-logging + input-pruning boilerplate.\n * Mirrors src/modules/headshotmarketing/tools/helpers.ts.\n *\n * Every FluidGrids operation is workspace tier, so `request` always goes to\n * `ctx.gql.workspace`. See ../operations.ts for why.\n */\n\nimport { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport {\n errorResult,\n registerTool,\n type McpContext,\n type ToolAnnotations,\n type ToolResult,\n} from '../../../core/index.js';\n\n/**\n * graphql-request's ClientError builds its `message` as\n * `<gql error>: ${JSON.stringify({ response, request })}` — and `request`\n * carries the operation's **variables**. For this module that means an API key\n * (credentials_auth_api_key) or a password (credentials_auth_basic) would land\n * in the log line and in the text returned to the MCP client.\n *\n * So never surface `error.message` from a transport error. When the error looks\n * like a ClientError, report only the GraphQL error messages from the response;\n * the request half is dropped entirely. Same defect class as BOFF-7165.\n */\nfunction isClientErrorShape(\n error: unknown,\n): error is { response?: { errors?: { message?: string }[]; status?: number } } {\n return typeof error === 'object' && error !== null && 'response' in error && 'request' in error;\n}\n\nexport function safeErrorMessage(error: unknown): string {\n if (isClientErrorShape(error)) {\n const errors = error.response?.errors;\n if (Array.isArray(errors) && errors.length > 0) {\n const joined = errors\n .map((e) => e?.message)\n .filter((m): m is string => typeof m === 'string' && m.length > 0)\n .join('; ');\n if (joined) return joined;\n }\n const status = error.response?.status;\n return status === undefined ? 'GraphQL request failed' : `GraphQL error (status ${status})`;\n }\n return error instanceof Error ? error.message : String(error);\n}\n\n/**\n * Run a tool body, mapping any thrown error to a uniform error ToolResult and\n * logging it under the module-prefixed label. `label` is the short tool suffix\n * (e.g. 'workflows_get').\n */\nexport async function runTool(\n ctx: McpContext,\n label: string,\n run: () => Promise<ToolResult>,\n): Promise<ToolResult> {\n try {\n return await run();\n } catch (error) {\n const message = safeErrorMessage(error);\n ctx.logger.error(`fluidgrids ${label} failed`, { error: message });\n return errorResult(`Failed (${label}): ${message}`);\n }\n}\n\n/** Copy only the defined (non-undefined) entries into a fresh object. */\nexport function definedInput(obj: Record<string, unknown>): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== undefined) out[key] = value;\n }\n return out;\n}\n\n/**\n * Build a WorkflowPaginationInput, or undefined when the caller passed neither\n * bound. Sending `{}` would override the schema's own defaults with nulls.\n */\nexport function workflowPagination(\n limit?: number,\n offset?: number,\n): Record<string, unknown> | undefined {\n if (limit === undefined && offset === undefined) return undefined;\n return definedInput({ limit, offset });\n}\n\n// The deployed date-ranged insight resolvers (`usageMetrics`, `usageTimeSeries`,\n// `detailedNodeUsage`, `workflowUsageSummary`, `errorAnalytics`) take a DateTime and\n// reject a date-only string with a generic \"Please check the information\" error\n// (BOFF-8716). Accept the date-only form and normalise it: start of day for a\n// range start, end of day for a range end.\nconst ISO_DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nexport function normalizeDate(value: string | undefined, endOfDay: boolean): string | undefined {\n if (typeof value !== 'string' || !ISO_DATE_ONLY.test(value)) return value;\n return `${value}T${endOfDay ? '23:59:59' : '00:00:00'}Z`;\n}\n\n/** Explicit annotation sets. Every FluidGrids tool declares one (G57). */\nexport const READ_ONLY: ToolAnnotations = {\n readOnlyHint: true,\n destructiveHint: false,\n openWorldHint: false,\n};\n/** A reversible write that stays inside FluidGrids. */\nexport const INTERNAL_WRITE: ToolAnnotations = {\n readOnlyHint: false,\n destructiveHint: false,\n openWorldHint: false,\n};\n/** A write that deletes or overwrites something the caller cannot read back. */\nexport const DESTRUCTIVE_WRITE: ToolAnnotations = {\n readOnlyHint: false,\n destructiveHint: true,\n openWorldHint: false,\n};\n\ntype ToolFn = <Shape extends z.ZodRawShape>(\n name: string,\n title: string,\n description: string,\n shape: Shape,\n annotations: ToolAnnotations,\n handler: (args: z.infer<z.ZodObject<Shape>>) => Promise<ToolResult>,\n) => void;\n\n/**\n * Compact registration for tools that send one workspace document: the input\n * is parsed strictly against its zod shape before anything is sent, and every\n * failure goes through runTool (so a transport error never leaks request\n * variables). `request` sends one document and returns its `root` field, null\n * when the answer has none.\n */\nexport function fluidgridsToolkit(\n server: McpServer,\n ctx: McpContext,\n track: (name: string) => string,\n): {\n tool: ToolFn;\n request: <T = unknown>(\n document: string,\n root: string,\n variables?: Record<string, unknown>,\n ) => Promise<T | null>;\n} {\n const tool: ToolFn = (name, title, description, shape, annotations, handler) => {\n registerTool(\n server,\n ctx,\n track(name),\n { title, description, inputSchema: shape, annotations },\n async (args) => runTool(ctx, name, () => handler(z.object(shape).strict().parse(args))),\n );\n };\n\n async function request<T = unknown>(\n document: string,\n root: string,\n variables: Record<string, unknown> = {},\n ): Promise<T | null> {\n const data = await ctx.gql.workspace.request<Record<string, T | null | undefined>>(\n document,\n definedInput(variables),\n );\n return data?.[root] ?? null;\n }\n\n return { tool, request };\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n AUTHENTICATE_CREDENTIAL_API_KEY,\n AUTHENTICATE_CREDENTIAL_BASIC,\n CREATE_CREDENTIAL,\n DELETE_CREDENTIAL,\n GET_CREDENTIAL,\n LIST_CREDENTIALS,\n LIST_CREDENTIAL_TYPES,\n TEST_CREDENTIAL,\n UPDATE_CREDENTIAL,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// FluidGrids credentials are Connections against a Provider, served by the\n// integrations subgraph. There is no `credential`/`credentialType` field on the\n// deployed schema — that naming is what made the old SDK documents unexecutable.\nfunction pagination(limit?: number, offset?: number): Record<string, unknown> | undefined {\n if (limit === undefined && offset === undefined) return undefined;\n return definedInput({ limit, offset });\n}\n\nexport function registerCredentialTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_list')),\n {\n title: 'List Credentials',\n description: 'List stored connections (credentials) available to workflows.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n providerId: z.string().optional().describe('Filter by provider ID'),\n name: z.string().optional().describe('Filter by name'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ providerId, name, limit, offset }) =>\n runTool(ctx, 'credentials_list', async () => {\n const filter = definedInput({ providerId, name });\n const data = await ctx.gql.workspace.request<{ getConnections: unknown }>(\n LIST_CREDENTIALS,\n {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: pagination(limit, offset),\n },\n );\n return jsonResult(data.getConnections);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_get')),\n {\n title: 'Get Credential',\n description: 'Get one connection by ID. Secret material is never returned.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Connection ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'credentials_get', async () => {\n const data = await ctx.gql.workspace.request<{ getConnection: unknown }>(GET_CREDENTIAL, {\n id,\n });\n return jsonResult(data.getConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_list_types')),\n {\n title: 'List Credential Types',\n description: 'List the providers a connection can be created against.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n name: z.string().optional().describe('Filter by provider name'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ name, limit, offset }) =>\n runTool(ctx, 'credentials_list_types', async () => {\n const filter = definedInput({ name });\n const data = await ctx.gql.workspace.request<{ getProviders: unknown }>(\n LIST_CREDENTIAL_TYPES,\n {\n filter: Object.keys(filter).length > 0 ? filter : undefined,\n pagination: pagination(limit, offset),\n },\n );\n return jsonResult(data.getProviders);\n }),\n );\n\n // BOFF-8720: the deployed `createConnection` resolver at\n // Algoshred/wspace-integrations-svc (PR #66, merged) now does a\n // `findFirst({ where: { OR: [{ id }, { key }] } })` so it accepts both\n // cuid and key forms of `providerId` AND persists the resolved\n // `provider.id` (not the raw input) to the FK column. The tool is\n // re-enabled here.\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_create')),\n {\n title: 'Create Credential',\n description:\n 'Create a connection against a provider. Secrets go to the vault; pass a reference, never a raw secret in config.',\n inputSchema: {\n name: z.string().describe('Connection name'),\n providerId: z.string().describe('Provider ID or key (e.g. \"openai\")'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Non-secret provider config as JSON'),\n context: z.unknown().optional().describe('Context JSON'),\n vaultId: z.string().optional().describe('Vault to store secret material in'),\n credentialSecretId: z.string().optional().describe('Existing vault secret reference'),\n managedSecretName: z.string().optional().describe('Managed secret name'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async (args) =>\n runTool(ctx, 'credentials_create', async () => {\n const data = await ctx.gql.workspace.request<{ createConnection: unknown }>(\n CREATE_CREDENTIAL,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_update')),\n {\n title: 'Update Credential',\n description: 'Update a connection’s name, description or non-secret config.',\n inputSchema: {\n id: z.string().describe('Connection ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Non-secret provider config as JSON'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'credentials_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateConnection: unknown }>(\n UPDATE_CREDENTIAL,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_delete')),\n {\n title: 'Delete Credential',\n description:\n 'Delete a connection. Set deleteVaultSecret to also destroy the stored secret — that is irreversible.',\n annotations: { destructiveHint: true },\n inputSchema: {\n id: z.string().describe('Connection ID'),\n deleteVaultSecret: z.boolean().optional().describe('Also delete the vault secret'),\n },\n },\n async ({ id, deleteVaultSecret }) =>\n runTool(ctx, 'credentials_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteConnection: unknown }>(\n DELETE_CREDENTIAL,\n { id, deleteVaultSecret },\n );\n return jsonResult(data.deleteConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_test')),\n {\n title: 'Test Credential',\n description: 'Verify a connection can authenticate against its provider.',\n annotations: { readOnlyHint: true },\n inputSchema: { connectionId: z.string().describe('Connection ID') },\n },\n async ({ connectionId }) =>\n runTool(ctx, 'credentials_test', async () => {\n const data = await ctx.gql.workspace.request<{ testConnection: unknown }>(TEST_CREDENTIAL, {\n connectionId,\n });\n return jsonResult(data.testConnection);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_auth_api_key')),\n {\n title: 'Authenticate Credential (API key)',\n description: 'Attach an API key to a connection via the API-key auth flow.',\n inputSchema: {\n connectionId: z.string().describe('Connection ID'),\n apiKey: z.string().describe('API key to store'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ connectionId, apiKey }) =>\n runTool(ctx, 'credentials_auth_api_key', async () => {\n const data = await ctx.gql.workspace.request<{ authenticateWithApiKey: unknown }>(\n AUTHENTICATE_CREDENTIAL_API_KEY,\n { input: { connectionId, apiKey } },\n );\n return jsonResult(data.authenticateWithApiKey);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'credentials_auth_basic')),\n {\n title: 'Authenticate Credential (basic)',\n description: 'Attach basic-auth credentials to a connection.',\n inputSchema: {\n connectionId: z.string().describe('Connection ID'),\n username: z.string().describe('Username'),\n password: z.string().describe('Password'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ connectionId, username, password }) =>\n runTool(ctx, 'credentials_auth_basic', async () => {\n const data = await ctx.gql.workspace.request<{ authenticateWithBasicAuth: unknown }>(\n AUTHENTICATE_CREDENTIAL_BASIC,\n { input: { connectionId, username, password } },\n );\n return jsonResult(data.authenticateWithBasicAuth);\n }),\n );\n}\n","/**\n * FluidGrids workflow data tools (BOFF-10887): variables, data tables, static\n * data and pinned node data.\n *\n * Variables are workflow configuration, so they can be created, changed and\n * deleted here. A secret or externally backed variable's value never reaches\n * the client: the backend returns null for it, and these tools drop it again\n * in case a backend ever does not. Revealing a value is left to the app.\n *\n * Data tables and static data are customer data the workflows read and write\n * at run time; they are read-only here. Pins only affect TEST runs.\n */\n\nimport { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { errorResult, jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport * as ops from '../extended-operations.js';\nimport {\n DESTRUCTIVE_WRITE,\n INTERNAL_WRITE,\n READ_ONLY,\n definedInput,\n fluidgridsToolkit,\n} from './helpers.js';\n\nconst text = z.string().trim().min(1);\nconst VariableScopeEnum = z.enum(['WORKSPACE', 'PROJECT']);\nconst SecretProviderEnum = z.enum([\n 'NONE',\n 'AWS_SECRETS_MANAGER',\n 'AZURE_KEY_VAULT',\n 'GCP_SECRET_MANAGER',\n 'VAULT',\n]);\nconst StaticDataScopeEnum = z.enum(['GLOBAL', 'NODE']);\nconst FilterOpEnum = z.enum([\n 'EQ',\n 'NEQ',\n 'GT',\n 'GTE',\n 'LT',\n 'LTE',\n 'CONTAINS',\n 'IS_NULL',\n 'IS_NOT_NULL',\n]);\n\ninterface VariableRow {\n isSecret?: boolean;\n externalProvider?: string;\n value?: unknown;\n}\n\ninterface VariableResult {\n variable?: VariableRow | null;\n}\n\n/** Drop the value of a secret or externally backed variable, whatever the backend sent. */\nfunction shown<T extends VariableRow | null | undefined>(variable: T): T {\n if (!variable) return variable;\n const hidden =\n variable.isSecret === true ||\n (variable.externalProvider !== undefined && variable.externalProvider !== 'NONE');\n return hidden ? { ...variable, value: null } : variable;\n}\n\nfunction shownResult(result: VariableResult | null): VariableResult | null {\n return result?.variable ? { ...result, variable: shown(result.variable) } : result;\n}\n\n/** The SDK's rule: a variable holds a value or points at an external secret, never both. */\nfunction variableSourceError(\n provider: string | undefined,\n externalRef: string | undefined,\n value: string | undefined,\n creating: boolean,\n): string | undefined {\n if (provider !== undefined && provider !== 'NONE') {\n if (creating && externalRef === undefined) {\n return 'externalRef is required with an externalProvider other than NONE.';\n }\n if (value !== undefined) return 'A variable has a value or an external reference, not both.';\n } else if (externalRef !== undefined && (provider === 'NONE' || creating)) {\n return 'externalRef needs an externalProvider other than NONE.';\n }\n return undefined;\n}\n\nexport function registerDataTools(\n server: McpServer,\n ctx: McpContext,\n track: (name: string) => string,\n): void {\n const { tool, request } = fluidgridsToolkit(server, ctx, track);\n\n // ── Variables ──────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'variables_list'),\n 'List Variables',\n 'Workflow variables ($vars), in key order (at most 500). Secret and externally backed values are returned as null.',\n {\n projectId: text.optional().describe('Only this project'),\n scope: VariableScopeEnum.optional().describe('WORKSPACE or PROJECT'),\n },\n READ_ONLY,\n async (args) => {\n const page = await request<{ variables?: VariableRow[] }>(\n ops.LIST_WORKFLOW_VARIABLES,\n 'workflowVariables',\n args,\n );\n if (!page?.variables) return jsonResult(page);\n return jsonResult({ ...page, variables: page.variables.map((v) => shown(v)) });\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'variables_get'),\n 'Get Variable',\n 'One workflow variable; null when there is none. A secret or externally backed value is returned as null.',\n { id: text.describe('Variable ID') },\n READ_ONLY,\n async (args) =>\n jsonResult(\n shown(await request<VariableRow>(ops.GET_WORKFLOW_VARIABLE, 'workflowVariable', args)),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'variables_create'),\n 'Create Variable',\n 'Create a workflow variable. Give it a value (isSecret: true stores it encrypted and never shows it again), or point it at an external secret with externalProvider + externalRef. scope PROJECT needs a projectId. A refusal (for example a taken key) comes back as success: false.',\n {\n key: z\n .string()\n .regex(/^[A-Za-z0-9_-]+$/, 'Letters, digits, _ and - only')\n .describe('Variable key, used as $vars.<key>'),\n value: z.string().optional().describe('Value (leave out for an external reference)'),\n isSecret: z.boolean().optional().describe('Store encrypted and never show it again'),\n description: z.string().optional().describe('Description'),\n scope: VariableScopeEnum.optional().describe('WORKSPACE (default) or PROJECT'),\n projectId: text.optional().describe('Project ID, with scope PROJECT only'),\n externalProvider: SecretProviderEnum.optional().describe('External secret store'),\n externalRef: text.optional().describe('Name of the secret in that store'),\n },\n INTERNAL_WRITE,\n async (args) => {\n if (args.scope === 'PROJECT' && args.projectId === undefined) {\n return errorResult(\"projectId is required when scope is 'PROJECT'.\");\n }\n if (args.scope !== 'PROJECT' && args.projectId !== undefined) {\n return errorResult(\"projectId only goes with scope 'PROJECT'.\");\n }\n const sourceError = variableSourceError(\n args.externalProvider,\n args.externalRef,\n args.value,\n true,\n );\n if (sourceError) return errorResult(sourceError);\n return jsonResult(\n shownResult(\n await request<VariableResult>(ops.CREATE_WORKFLOW_VARIABLE, 'createWorkflowVariable', {\n input: definedInput({ ...args }),\n }),\n ),\n );\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'variables_update'),\n 'Update Variable',\n 'Change a workflow variable. Workflows read the new value on their next run. The old value of a secret variable cannot be read back, so overwriting it is final.',\n {\n id: text.describe('Variable ID'),\n value: z.string().optional().describe('New value'),\n isSecret: z.boolean().optional().describe('Store encrypted'),\n description: z.string().optional().describe('Description'),\n externalProvider: SecretProviderEnum.optional().describe('External secret store'),\n externalRef: text.optional().describe('Name of the secret in that store'),\n },\n DESTRUCTIVE_WRITE,\n async ({ id, ...input }) => {\n const sourceError = variableSourceError(\n input.externalProvider,\n input.externalRef,\n input.value,\n false,\n );\n if (sourceError) return errorResult(sourceError);\n const changes = definedInput(input);\n if (Object.keys(changes).length === 0) return errorResult('Nothing to update.');\n return jsonResult(\n shownResult(\n await request<VariableResult>(ops.UPDATE_WORKFLOW_VARIABLE, 'updateWorkflowVariable', {\n id,\n input: changes,\n }),\n ),\n );\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'variables_delete'),\n 'Delete Variable',\n 'Delete a workflow variable. Workflows that read it get no value from their next run on.',\n { id: text.describe('Variable ID') },\n DESTRUCTIVE_WRITE,\n async (args) =>\n jsonResult(await request(ops.DELETE_WORKFLOW_VARIABLE, 'deleteWorkflowVariable', args)),\n );\n\n // ── Data tables (read-only) ────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'data_tables_list'),\n 'List Data Tables',\n 'The data tables of the workspace with their columns and row counts. `total` is how many match.',\n {\n search: z.string().optional().describe('Name search'),\n limit: z.number().int().min(1).optional().describe('Page size'),\n offset: z.number().int().min(0).optional().describe('Offset'),\n },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.LIST_DATA_TABLES, 'dataTables', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'data_tables_get'),\n 'Get Data Table',\n 'One data table with its columns; null when there is none.',\n { id: text.describe('Data table ID') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_DATA_TABLE, 'dataTable', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'data_tables_query_rows'),\n 'Query Data Table Rows',\n 'Rows of a data table, newest first, optionally filtered by column. IS_NULL and IS_NOT_NULL take no value; the other operators need one.',\n {\n tableId: text.describe('Data table ID'),\n filters: z\n .array(\n z\n .object({\n column: text.describe('Column key'),\n op: FilterOpEnum.describe('Comparison'),\n value: z.unknown().optional().describe('Value to compare with'),\n })\n .strict(),\n )\n .optional()\n .describe('All must match'),\n limit: z.number().int().min(1).max(5000).optional().describe('Page size, 1-5000'),\n offset: z.number().int().min(0).optional().describe('Offset'),\n },\n READ_ONLY,\n async ({ filters, ...rest }) => {\n for (const [index, filter] of (filters ?? []).entries()) {\n const takesNoValue = filter.op === 'IS_NULL' || filter.op === 'IS_NOT_NULL';\n if (takesNoValue && filter.value !== undefined) {\n return errorResult(`filters[${index}]: ${filter.op} takes no value.`);\n }\n if (!takesNoValue && (filter.value === undefined || filter.value === null)) {\n return errorResult(`filters[${index}]: ${filter.op} needs a value.`);\n }\n }\n return jsonResult(\n await request(ops.QUERY_DATA_TABLE_ROWS, 'dataTableRows', {\n input: definedInput({ ...rest, filters }),\n }),\n );\n },\n );\n\n // ── Static data (read-only) ────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'static_data_get'),\n 'Get Static Data',\n 'The state a workflow keeps between runs (for example a polling trigger’s cursor): the GLOBAL blob, or one NODE blob by nodeId. Null when there is none.',\n {\n workflowKey: text.describe('Workflow key'),\n scope: StaticDataScopeEnum.describe('GLOBAL, or NODE with a nodeId'),\n nodeId: text.optional().describe('Graph node ID (NODE scope only)'),\n },\n READ_ONLY,\n async (args) => {\n if (args.scope === 'NODE' && args.nodeId === undefined) {\n return errorResult('nodeId is required with the NODE scope.');\n }\n if (args.scope === 'GLOBAL' && args.nodeId !== undefined) {\n return errorResult('nodeId applies to the NODE scope only.');\n }\n return jsonResult(await request(ops.GET_WORKFLOW_STATIC_DATA, 'workflowStaticData', args));\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'static_data_list'),\n 'List Static Data',\n 'Every static-data blob of a workflow: the GLOBAL one first, then one per node.',\n { workflowKey: text.describe('Workflow key') },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.LIST_WORKFLOW_STATIC_DATA, 'workflowStaticDataList', args)),\n );\n\n // ── Pinned data ────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'pinned_data_pin'),\n 'Pin Node Data',\n 'Pin the output a node returns in TEST runs of one stored workflow version (by its row id, not its key). Replaces the node’s earlier pin. PRODUCTION runs never use pins.',\n {\n id: text.describe('Workflow definition (version row) ID'),\n nodeId: text.describe('Graph node ID'),\n data: z\n .unknown()\n .refine((value) => value !== undefined && value !== null, 'data must be a JSON value')\n .describe('The output to pin, as JSON'),\n },\n INTERNAL_WRITE,\n async (args) => jsonResult(await request(ops.PIN_NODE_DATA, 'pinNodeData', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'pinned_data_unpin'),\n 'Unpin Node Data',\n 'Remove the pinned output of a node, so TEST runs execute it again. The pinned data is gone afterwards.',\n {\n id: text.describe('Workflow definition (version row) ID'),\n nodeId: text.describe('Graph node ID'),\n },\n DESTRUCTIVE_WRITE,\n async (args) => jsonResult(await request(ops.UNPIN_NODE_DATA, 'unpinNodeData', args)),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n GET_DASHBOARD_SUMMARY,\n GET_SYSTEM_CONFIG,\n GET_USAGE_METRICS,\n SEARCH,\n SEARCH_BY_ENTITY_TYPE,\n} from '../operations.js';\nimport { definedInput, normalizeDate, runTool } from './helpers.js';\n\n/**\n * Read-only cross-cutting tools: dashboard, usage, search and system config.\n * Grouped in one file because each is one or two operations and they share no\n * domain object with the workflow surface.\n */\nexport function registerInsightTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'dashboard_summary')),\n {\n title: 'Dashboard Summary',\n description: 'Workflow, run and failure counters for the current workspace.',\n annotations: { readOnlyHint: true },\n inputSchema: { projectId: z.string().optional().describe('Scope to one project') },\n },\n async ({ projectId }) =>\n runTool(ctx, 'dashboard_summary', async () => {\n const data = await ctx.gql.workspace.request<{ dashboardSummary: unknown }>(\n GET_DASHBOARD_SUMMARY,\n { projectId },\n );\n return jsonResult(data.dashboardSummary);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'usage_metrics')),\n {\n title: 'Usage Metrics',\n description: 'Usage metrics over a date range — run minutes and execution counts.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n startDate: z.string().describe('ISO 8601 start of the range'),\n endDate: z.string().describe('ISO 8601 end of the range'),\n userId: z.string().optional().describe('Scope to one user'),\n contextFilter: z.unknown().optional().describe('Context filter as JSON'),\n },\n },\n async (args) =>\n runTool(ctx, 'usage_metrics', async () => {\n const normalised: Record<string, unknown> = {\n ...args,\n startDate: normalizeDate(args.startDate, false),\n endDate: normalizeDate(args.endDate, true),\n };\n const data = await ctx.gql.workspace.request<{ usageMetrics: unknown }>(GET_USAGE_METRICS, {\n input: definedInput(normalised),\n });\n return jsonResult(data.usageMetrics);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'search')),\n {\n title: 'Search',\n description: 'Search across FluidGrids entities. Narrow with entityTypes when you know it.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n query: z.string().describe('Search query'),\n entityTypes: z.array(z.string()).optional().describe('Restrict to these entity types'),\n filters: z.unknown().optional().describe('Additional filters as JSON'),\n highlight: z.boolean().optional().describe('Return highlighted snippets'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async (args) =>\n runTool(ctx, 'search', async () => {\n const data = await ctx.gql.workspace.request<{ search: unknown }>(SEARCH, {\n input: definedInput({ ...args }),\n });\n return jsonResult(data.search);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'search_by_entity_type')),\n {\n title: 'Search By Entity Type',\n description: 'Search within a single entity type.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n entityType: z.string().describe('Entity type to search'),\n query: z.string().describe('Search query'),\n filters: z.unknown().optional().describe('Additional filters as JSON'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async (args) =>\n runTool(ctx, 'search_by_entity_type', async () => {\n const data = await ctx.gql.workspace.request<{ searchByEntityType: unknown }>(\n SEARCH_BY_ENTITY_TYPE,\n definedInput({ ...args }),\n );\n return jsonResult(data.searchByEntityType);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'system_config')),\n {\n title: 'System Config',\n description: 'Read the workflow engine’s effective system configuration.',\n annotations: { readOnlyHint: true },\n inputSchema: {},\n },\n async () =>\n runTool(ctx, 'system_config', async () => {\n const data = await ctx.gql.workspace.request<{ systemConfig: unknown }>(GET_SYSTEM_CONFIG);\n return jsonResult(data.systemConfig);\n }),\n );\n}\n","/**\n * FluidGrids inspection tools (BOFF-10887): read what a workflow, a run, a node\n * or the workspace's integrations look like, without changing anything. The two\n * writes here only bring something back: a workflow version as a new DRAFT, and\n * a deleted scheduled job.\n *\n * Operations the SDK has that are deliberately NOT tools (re-running a run or a\n * node, deciding a tool approval, configuring log streams or secrets providers,\n * installing nodes, live subscriptions) are listed with the reason in\n * .parity-allowlist.yaml.\n */\n\nimport { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { errorResult, jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport * as ops from '../extended-operations.js';\nimport {\n INTERNAL_WRITE,\n READ_ONLY,\n definedInput,\n fluidgridsToolkit,\n normalizeDate,\n workflowPagination,\n} from './helpers.js';\n\nconst text = z.string().trim().min(1);\nconst limit = z.number().int().min(1);\nconst offset = z.number().int().min(0);\nconst date = (what: string): z.ZodString =>\n z.string().describe(`${what}: ISO 8601 date-time, or a date (YYYY-MM-DD) for the whole day`);\n\ninterface NodeStateRow {\n id: string;\n nodeId: string;\n}\n\nexport function registerInspectTools(\n server: McpServer,\n ctx: McpContext,\n track: (name: string) => string,\n): void {\n const { tool, request } = fluidgridsToolkit(server, ctx, track);\n\n // ── Workflows ──────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'workflows_summary'),\n 'Workflow Summary',\n 'How many versions a workflow has, which is the latest, and when it was created and last changed.',\n { workflowKey: text.describe('Workflow key') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_WORKFLOW_SUMMARY, 'workflowSummary', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_diff_versions'),\n 'Diff Workflow Versions',\n 'How two versions of a workflow differ: one entry per changed path of the definition (at most 2000; `truncated` says when more changed).',\n {\n workflowKey: text.describe('Workflow key'),\n fromVersion: text.describe('Older version'),\n toVersion: text.describe('Newer version'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.DIFF_WORKFLOW_VERSIONS, 'workflowVersionDiff', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_restore_version'),\n 'Restore Workflow Version',\n 'Copy an old version of a workflow into a new DRAFT version. The old version and the active one are not changed; publish the draft to make it live.',\n { workflowKey: text.describe('Workflow key'), version: text.describe('Version to copy') },\n INTERNAL_WRITE,\n async (args) =>\n jsonResult(await request(ops.RESTORE_WORKFLOW_VERSION, 'restoreWorkflowVersion', args)),\n );\n\n // ── Runs ───────────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'runs_hierarchy'),\n 'Run Hierarchy',\n 'The tree of sub-workflow runs a run started, up to six levels deep, with the node of the parent that started each one.',\n { runId: text.describe('Run ID') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_RUN_HIERARCHY, 'workflowRunHierarchy', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_node_states'),\n 'Run Node States',\n 'Every node execution of a run with its status, error and output. Poll this to follow a run while it is going: MCP has no live subscription.',\n { runId: text.describe('Run ID') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.LIST_NODE_STATES, 'nodeStates', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_node_state'),\n 'Run Node State',\n 'One node execution with the inputs it received. Pass the node state `id` from fluidgrids_runs_node_states, or a `runId` and graph `nodeId` (refused when that node ran in parallel instances; then pass the id).',\n {\n id: text.optional().describe('Node state ID'),\n runId: text.optional().describe('Run ID (with nodeId)'),\n nodeId: text.optional().describe('Graph node ID (with runId)'),\n },\n READ_ONLY,\n async ({ id, runId, nodeId }) => {\n if (id !== undefined) {\n if (runId !== undefined || nodeId !== undefined) {\n return errorResult('Pass either id, or runId and nodeId, not both.');\n }\n return jsonResult(await request(ops.GET_NODE_STATE, 'nodeState', { id }));\n }\n if (runId === undefined || nodeId === undefined) {\n return errorResult('Pass a node state id, or both runId and nodeId.');\n }\n const states = await request<NodeStateRow[]>(ops.LIST_NODE_STATES, 'nodeStates', { runId });\n const matching = (states ?? []).filter((state) => state.nodeId === nodeId);\n if (matching.length === 0) return jsonResult(null);\n if (matching.length > 1) {\n return errorResult(\n `Node ${nodeId} has ${matching.length} states in run ${runId} (parallel instances); pass one of these ids instead: ${matching.map((s) => s.id).join(', ')}`,\n );\n }\n return jsonResult(await request(ops.GET_NODE_STATE, 'nodeState', { id: matching[0].id }));\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_can_run_from_node'),\n 'Can Run From Node',\n 'Read-only check whether a new run could start at a node of a past run, reusing its upstream outputs, and what blocks it if not.',\n {\n sourceRunId: text.describe('The past run to reuse'),\n nodeId: text.describe('Graph node ID to start at'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.CAN_RUN_FROM_NODE, 'runFromNodeEligibility', { input: args })),\n );\n\n // ── Nodes ──────────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'nodes_list_custom'),\n 'List Custom Nodes',\n 'The custom nodes registered for the workspace, page by page.',\n {\n page: limit.optional().describe('Page number, from 1'),\n limit: limit.optional().describe('Page size'),\n },\n READ_ONLY,\n async ({ page, limit: size }) => {\n const pagination = definedInput({ page, limit: size });\n return jsonResult(\n await request(ops.LIST_CUSTOM_NODES, 'customNodes', {\n pagination: Object.keys(pagination).length > 0 ? pagination : undefined,\n }),\n );\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_manifest'),\n 'Node Manifest',\n 'The manifest of one node version (inputs, operations, credentials), as JSON. Null when there is no such node. It can be large.',\n {\n nodeType: text.describe('Node type, e.g. internal:http'),\n version: text.describe('Node version'),\n },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_NODE_MANIFEST, 'nodeManifest', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_usage_status'),\n 'Node Usage Status',\n 'Which workflows of the workspace use a node version.',\n { nodeType: text.describe('Node type'), nodeVersion: text.describe('Node version') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_NODE_USAGE_STATUS, 'nodeUsageStatus', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_list_operation_configs'),\n 'List Operation Configs',\n 'The stored configurations of node operations, newest first, optionally for one node type and version.',\n {\n nodeType: text.optional().describe('Node type'),\n nodeVersion: text.optional().describe('Node version'),\n limit: limit.optional().describe('Page size'),\n offset: offset.optional().describe('Offset'),\n },\n READ_ONLY,\n async ({ nodeType, nodeVersion, limit: size, offset: from }) =>\n jsonResult(\n await request(ops.LIST_OPERATION_CONFIGS, 'operationConfigs', {\n nodeType,\n nodeVersion,\n pagination: workflowPagination(size, from),\n }),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_get_operation_config'),\n 'Get Operation Config',\n 'The stored configuration of one operation of one node version; null when there is none.',\n {\n nodeType: text.describe('Node type'),\n nodeVersion: text.describe('Node version'),\n operationName: text.describe('Operation name'),\n },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.GET_OPERATION_CONFIG, 'operationConfig', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'nodes_list_installations'),\n 'List Node Installations',\n 'The nodes this workspace has installed, whether each is enabled, and its workspace settings.',\n {},\n READ_ONLY,\n async () =>\n jsonResult(await request(ops.LIST_NODE_INSTALLATIONS, 'workspaceNodeInstallations')),\n );\n\n // ── Webhook deliveries ─────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'webhooks_list_deliveries'),\n 'List Webhook Deliveries',\n 'The newest requests that reached one webhook, with validation result, the run it started and any error. Credentials in headers are masked by the backend; bodies are what the sender sent.',\n {\n eventRegistrationId: text.describe('Webhook (event registration) ID'),\n limit: limit.optional().describe('How many (default 50)'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.LIST_WEBHOOK_DELIVERIES, 'webhookDeliveryLogs', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'webhooks_list_all_deliveries'),\n 'List All Webhook Deliveries',\n 'The newest webhook requests across every webhook of the workspace. Filter with validationPassed: false to find rejected ones.',\n {\n limit: z.number().int().min(1).max(100).optional().describe('How many, 1-100 (default 50)'),\n offset: offset.optional().describe('Offset'),\n validationPassed: z.boolean().optional().describe('Only passed (true) or failed (false)'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.LIST_ALL_WEBHOOK_DELIVERIES, 'allWebhookDeliveries', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'webhooks_list_filters'),\n 'List Webhook Filters',\n 'The event filters a request must pass before a webhook starts a run.',\n { eventRegistrationId: text.describe('Webhook (event registration) ID') },\n READ_ONLY,\n async (args) => jsonResult(await request(ops.LIST_WEBHOOK_EVENT_FILTERS, 'eventFilters', args)),\n );\n\n // ── Scheduled jobs ─────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'scheduled_jobs_scheduler_status'),\n 'Scheduler Status',\n 'A snapshot of the workflow scheduler: whether it runs and how many schedules the answering process holds.',\n {},\n READ_ONLY,\n async () => jsonResult(await request(ops.GET_SCHEDULER_STATUS, 'workflowScheduledJobsStatus')),\n );\n\n tool(\n mcpToolName(ctx.productName, 'scheduled_jobs_restore'),\n 'Restore Scheduled Job',\n 'Bring back a deleted scheduled job. It runs on its schedule again if it was enabled.',\n { jobId: text.describe('Scheduled job ID') },\n { ...INTERNAL_WRITE, openWorldHint: true },\n async (args) =>\n jsonResult(await request(ops.RESTORE_SCHEDULED_JOB, 'restoreScheduledJob', args)),\n );\n\n // ── Insights ───────────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'dashboard_error_analytics'),\n 'Error Analytics',\n 'Failed runs and nodes over a window (the 30 days before endDate, now by default): errors by type, the workflows and nodes that fail most, and a daily trend.',\n {\n startDate: date('Start of the window').optional(),\n endDate: date('End of the window').optional(),\n limit: limit.optional().describe('How many top workflows and nodes'),\n },\n READ_ONLY,\n async ({ startDate, endDate, limit: top }) =>\n jsonResult(\n await request(ops.GET_ERROR_ANALYTICS, 'errorAnalytics', {\n input: definedInput({\n startDate: normalizeDate(startDate, false),\n endDate: normalizeDate(endDate, true),\n limit: top,\n }),\n }),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'usage_time_series'),\n 'Usage Time Series',\n 'Runs (by outcome), node executions and durations per time bucket over a date range.',\n {\n startDate: date('Start of the range'),\n endDate: date('End of the range'),\n granularity: z.enum(['hour', 'day', 'week', 'month']).optional().describe('Default day'),\n userId: text.optional().describe('Only runs this user started'),\n },\n READ_ONLY,\n async ({ startDate, endDate, granularity, userId }) =>\n jsonResult(\n await request(ops.GET_USAGE_TIME_SERIES, 'usageTimeSeries', {\n input: definedInput({\n startDate: normalizeDate(startDate, false),\n endDate: normalizeDate(endDate, true),\n granularity,\n userId,\n }),\n }),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'usage_detailed_node_usage'),\n 'Detailed Node Usage',\n 'Executions, outcomes and duration statistics per node type and version over a date range.',\n {\n startDate: date('Start of the range'),\n endDate: date('End of the range'),\n nodeType: text.optional().describe('Only this node type'),\n },\n READ_ONLY,\n async ({ startDate, endDate, nodeType }) =>\n jsonResult(\n await request(ops.GET_DETAILED_NODE_USAGE, 'detailedNodeUsage', {\n input: definedInput({\n startDate: normalizeDate(startDate, false),\n endDate: normalizeDate(endDate, true),\n nodeType,\n }),\n }),\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'usage_workflow_usage_summary'),\n 'Workflow Usage Summary',\n 'Workflow runs, node executions, run duration and node minutes over a date range. It reports usage only, not cost: charges come from the billing service. Read-only.',\n { startDate: date('Start of the range'), endDate: date('End of the range') },\n READ_ONLY,\n async ({ startDate, endDate }) =>\n jsonResult(\n await request(ops.GET_WORKFLOW_USAGE_SUMMARY, 'workflowUsageSummary', {\n input: {\n startDate: normalizeDate(startDate, false),\n endDate: normalizeDate(endDate, true),\n },\n }),\n ),\n );\n\n // ── Tool approvals ─────────────────────────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'tool_approvals_list_pending'),\n 'List Pending Tool Approvals',\n 'AI Agent tool calls that wait for a person to approve or reject them. Deciding is left to a person in the FluidGrids app on purpose.',\n {\n limit: limit.optional().describe('Page size (default 50)'),\n offset: offset.optional().describe('Offset'),\n },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.LIST_PENDING_TOOL_APPROVALS, 'pendingToolApprovals', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'tool_approvals_get'),\n 'Get Tool Approval',\n 'One tool-approval request: the tool calls it holds, the decisions made, and its timeout.',\n { id: text.describe('Tool approval request ID') },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.GET_TOOL_APPROVAL_REQUEST, 'toolApprovalRequest', args)),\n );\n\n // ── Log streams and secrets providers ──────────────────────────────────\n tool(\n mcpToolName(ctx.productName, 'log_streams_list'),\n 'List Log Streams',\n 'Where the workspace streams run logs, and how the last dispatch went. Stored secrets are never returned (`hasSecret` says whether one is set).',\n {},\n READ_ONLY,\n async () =>\n jsonResult(await request(ops.LIST_LOG_STREAM_DESTINATIONS, 'logStreamDestinations')),\n );\n\n tool(\n mcpToolName(ctx.productName, 'log_streams_get'),\n 'Get Log Stream',\n 'One log stream destination; the stored secret is never returned.',\n { id: text.describe('Log stream destination ID') },\n READ_ONLY,\n async (args) =>\n jsonResult(await request(ops.GET_LOG_STREAM_DESTINATION, 'logStreamDestination', args)),\n );\n\n tool(\n mcpToolName(ctx.productName, 'secrets_providers_list'),\n 'List Secrets Providers',\n 'The external secret stores the workspace has configured (AWS, Azure, GCP, Vault) and their last connection test. No credential is returned.',\n {},\n READ_ONLY,\n async () =>\n jsonResult(await request(ops.LIST_SECRETS_PROVIDER_CONFIGS, 'secretsProviderConfigs')),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport { GET_NODE, LIST_NODES } from '../operations.js';\nimport { runTool, workflowPagination } from './helpers.js';\n\nconst PublishTypeEnum = z.enum(['BUILTIN', 'CUSTOM', 'STORE']);\nconst NodeConfigStatusEnum = z.enum(['AVAILABLE', 'DEPRECATED', 'DISABLED']);\n\nexport function registerNodeTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'nodes_list')),\n {\n title: 'List Nodes',\n description:\n 'List the node types available to build workflows with, from the node endpoint config registry.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n nodeType: z.string().optional().describe('Filter by node type'),\n publishType: PublishTypeEnum.optional().describe('BUILTIN, CUSTOM or STORE'),\n status: NodeConfigStatusEnum.optional().describe('Filter by availability'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ nodeType, publishType, status, limit, offset }) =>\n runTool(ctx, 'nodes_list', async () => {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfigs: unknown }>(LIST_NODES, {\n nodeType,\n publishType,\n status,\n pagination: workflowPagination(limit, offset),\n });\n return jsonResult(data.nodeEndpointConfigs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'nodes_get')),\n {\n title: 'Get Node',\n description:\n 'Get one node type at a specific version, including its input fields and operations.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n nodeType: z.string().describe('Node type identifier'),\n nodeVersion: z.string().describe('Node version'),\n },\n },\n async ({ nodeType, nodeVersion }) =>\n runTool(ctx, 'nodes_get', async () => {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfig: unknown }>(GET_NODE, {\n nodeType,\n nodeVersion,\n });\n return jsonResult(data.nodeEndpointConfig);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { errorResult, jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CANCEL_RUN,\n GET_RUN,\n GET_RUN_LOGS,\n LIST_RUNS,\n PAUSE_RUN,\n RESUME_RUN,\n RETRY_RUN,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// The deployed RunStatus enum is UPPERCASE. Comparing against lowercase is what\n// made `fluidgrids runs wait` never terminate (BOFF-7091) — keep these exact.\nconst RunStatusEnum = z.enum([\n 'CANCELLED',\n 'COMPLETED',\n 'FAILED',\n 'PENDING',\n 'RUNNING',\n 'TERMINATED',\n 'WAITING',\n]);\nconst RunLogLevelEnum = z.enum(['DEBUG', 'ERROR', 'INFO', 'WARN']);\n\nexport function registerRunTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_list')),\n {\n title: 'List Runs',\n description: 'List workflow runs, optionally filtered by workflowKey and status.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n status: RunStatusEnum.optional().describe('Filter by run status'),\n limit: z.number().optional().describe('Max results (default 10)'),\n offset: z.number().optional().describe('Offset for pagination (default 0)'),\n },\n },\n async ({ workflowKey, status, limit, offset }) =>\n runTool(ctx, 'runs_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRuns: unknown }>(LIST_RUNS, {\n input: definedInput({ workflowKey, status, limit, offset }),\n });\n return jsonResult(data.workflowRuns);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_get')),\n {\n title: 'Get Run',\n description:\n 'Get one workflow run, including per-node state. Poll this to follow a run to a terminal status.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRun: unknown }>(GET_RUN, { id });\n return jsonResult(data.workflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_logs')),\n {\n title: 'Get Run Logs',\n description:\n 'Read a run log, newest page first. Keyset paginated: pass the previous page cursor as `after`.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n runId: z.string().describe('Run ID'),\n nodeId: z.string().optional().describe('Restrict to one node'),\n minLevel: RunLogLevelEnum.optional().describe('Minimum log level'),\n limit: z.number().optional().describe('Max log lines'),\n after: z.string().optional().describe('Keyset cursor from a previous page'),\n search: z.string().optional().describe('Substring filter'),\n includeChildRuns: z.boolean().optional().describe('Include logs from child runs'),\n },\n },\n async (args) =>\n runTool(ctx, 'runs_logs', async () => {\n const data = await ctx.gql.workspace.request<{ workflowRunLogs: unknown }>(\n GET_RUN_LOGS,\n definedInput({ ...args }),\n );\n return jsonResult(data.workflowRunLogs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_cancel')),\n {\n title: 'Cancel Run',\n description: 'Cancel an in-flight run. Terminal runs cannot be cancelled.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Run ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_cancel', async () => {\n const data = await ctx.gql.workspace.request<{ cancelWorkflowRun: unknown }>(CANCEL_RUN, {\n id,\n });\n return jsonResult(data.cancelWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_pause')),\n {\n title: 'Pause Run',\n description: 'Pause a running workflow run.',\n inputSchema: { id: z.string().describe('Run ID') },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id }) =>\n runTool(ctx, 'runs_pause', async () => {\n const data = await ctx.gql.workspace.request<{ pauseWorkflowRun: unknown }>(PAUSE_RUN, {\n id,\n });\n return jsonResult(data.pauseWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_resume')),\n {\n title: 'Resume Run',\n description:\n 'Resume a paused or waiting run. `payload` supplies the data a Wait node is blocked on.',\n inputSchema: {\n id: z.string().describe('Run ID'),\n payload: z.unknown().optional().describe('Payload to resume with'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n async ({ id, payload }) =>\n runTool(ctx, 'runs_resume', async () => {\n const data = await ctx.gql.workspace.request<{ resumeWorkflowRun: unknown }>(RESUME_RUN, {\n id,\n payload,\n });\n return jsonResult(data.resumeWorkflowRun);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'runs_retry_node')),\n {\n title: 'Retry Node',\n description: 'Re-execute one failed node within a run, continuing from there.',\n inputSchema: {\n id: z.string().describe('Run ID'),\n nodeId: z.string().describe('Node ID to retry'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n async ({ id: runId, nodeId }) =>\n runTool(ctx, 'runs_retry_node', async () => {\n // The deployed resolver takes a NodeState id, not a run id. Look the run\n // up to find the matching NodeState, then forward that id.\n const runData = await ctx.gql.workspace.request<{\n workflowRun: { nodeStates: Array<{ id: string; nodeId: string; status: string }> } | null;\n }>(GET_RUN, { id: runId });\n const states =\n runData.workflowRun?.nodeStates?.filter(\n (s) => s.nodeId === nodeId && ['FAILED', 'TIMEOUT'].includes(s.status),\n ) ?? [];\n const [state] = states;\n if (!state || states.length !== 1) {\n return errorResult(`Expected one failed node state for run ${runId} node ${nodeId}`);\n }\n const data = await ctx.gql.workspace.request<{ retryNode: unknown }>(RETRY_RUN, {\n id: state.id,\n nodeId,\n });\n return jsonResult(data.retryNode);\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport {\n jsonResult,\n mcpToolName,\n registerTool,\n McpUserError,\n type McpContext,\n type ToolResult,\n type ToolAnnotations,\n} from '../../../core/index.js';\nimport * as ops from '../durable-operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\nconst text = z.string().trim().min(1);\nconst json = z\n .unknown()\n .refine((value) => value !== undefined && value !== null, 'JSON is required');\nconst target = z\n .object({ workflowKey: text, workflowId: text.max(256), firstRunId: text.optional() })\n .strict();\nconst run = z\n .union([text, target])\n .describe('A run ID or a workflowKey/workflowId target, optionally pinned by firstRunId');\nconst read = { readOnlyHint: true, destructiveHint: false, openWorldHint: false };\nconst write = { readOnlyHint: false, destructiveHint: false, openWorldHint: true };\nconst destructive = { readOnlyHint: false, destructiveHint: true, openWorldHint: true };\nconst duration = z.union([z.number().int().nonnegative(), text]).transform(String);\n\nconst startShape = {\n workflowKey: text,\n version: text.optional(),\n workflowFn: text.optional(),\n input: z.unknown().optional(),\n signals: z\n .array(z.object({ name: text, payload: z.unknown().optional() }).strict())\n .max(100)\n .optional(),\n idempotencyKey: text.optional(),\n workflowId: text.max(256).optional(),\n idReusePolicy: z\n .enum(['ALLOW_DUPLICATE', 'ALLOW_DUPLICATE_FAILED_ONLY', 'REJECT_DUPLICATE'])\n .optional(),\n idConflictPolicy: z.enum(['FAIL', 'USE_EXISTING', 'TERMINATE_EXISTING']).optional(),\n summary: z.string().max(200).optional(),\n details: z.string().optional(),\n memo: z.record(z.string(), z.unknown()).optional(),\n startDelay: duration.optional(),\n executionTimeout: duration.optional(),\n runTimeout: duration.optional(),\n workflowTaskTimeout: duration.optional(),\n priority: z.number().int().min(1).max(5).optional(),\n completionCallback: z\n .object({\n url: text.url().refine((url) => /^https?:/.test(url), 'Use an HTTP(S) callback URL'),\n headers: z.record(z.string(), z.string()).optional(),\n signingSecret: z.string().min(16).max(512).optional(),\n })\n .strict()\n .optional(),\n versioningBehavior: z.enum(['PINNED', 'AUTO_UPGRADE']).optional(),\n};\n\n/** Register the SDK's code-first and durable operations, without bypassing gateway RBAC. */\nexport function registerDurableTools(\n server: McpServer,\n ctx: McpContext,\n track: (name: string) => string,\n): void {\n function tool<Shape extends z.ZodRawShape>(\n name: string,\n title: string,\n description: string,\n shape: Shape,\n annotations: ToolAnnotations,\n handler: (args: z.infer<z.ZodObject<Shape>>) => Promise<ToolResult>,\n ): void {\n registerTool(\n server,\n ctx,\n track(name),\n { title, description, inputSchema: shape, annotations },\n async (args) => runTool(ctx, name, () => handler(z.object(shape).strict().parse(args))),\n );\n }\n\n async function request(\n document: string,\n variables: Record<string, unknown>,\n root: string,\n ): Promise<ToolResult> {\n const data = await ctx.gql.workspace.request<Record<string, unknown>>(\n document,\n definedInput(variables),\n );\n return jsonResult(data[root] ?? null);\n }\n\n tool(\n mcpToolName(ctx.productName, 'runs_by_workflow_id'),\n 'Run by Workflow ID',\n 'Read the latest visible run of a workflow ID. firstRunId pins its continue-as-new chain. Requires durable parity.',\n target.shape,\n read,\n (args) => request(ops.RUN_BY_WORKFLOW_ID, args, 'workflowRunByWorkflowId'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_describe'),\n 'Describe Durable Run',\n 'Read execution kind, durable state and determinism status. A workflow-ID target also returns chain metadata.',\n { run },\n read,\n ({ run: ref }) =>\n typeof ref === 'string'\n ? request(ops.DESCRIBE_RUN, { id: ref }, 'workflowRun')\n : request(ops.RUN_BY_WORKFLOW_ID, ref, 'workflowRunByWorkflowId'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_pending'),\n 'Pending Run Work',\n 'Read pending activities, children, timers, buffered signals and the open workflow task. Requires durable parity.',\n { run },\n read,\n async ({ run: ref }) => {\n const byId = typeof ref === 'string';\n const data = await ctx.gql.workspace.request<\n Record<string, { id: string; status: string; pending: unknown } | null>\n >(byId ? ops.RUN_PENDING : ops.RUN_PENDING_BY_WORKFLOW_ID, byId ? { id: ref } : ref);\n const row = data[byId ? 'workflowRun' : 'workflowRunByWorkflowId'];\n return jsonResult(row ? { runId: row.id, status: row.status, pending: row.pending } : null);\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_count'),\n 'Count Runs',\n 'Count visible runs, optionally grouped by up to two columns. No pagination applies. Requires durable parity.',\n {\n filter: z\n .object({\n status: z\n .enum([\n 'CANCELLED',\n 'COMPLETED',\n 'FAILED',\n 'PENDING',\n 'RUNNING',\n 'TERMINATED',\n 'WAITING',\n ])\n .optional(),\n workflowKey: text.optional(),\n nodeId: text.optional(),\n search: z.string().optional(),\n startDate: text.optional(),\n endDate: text.optional(),\n errorType: text.optional(),\n durationMinSeconds: z.number().nonnegative().optional(),\n durationMaxSeconds: z.number().nonnegative().optional(),\n executionKind: z.enum(['GRAPH', 'DURABLE_FN']).optional(),\n businessId: text.optional(),\n firstRunId: text.optional(),\n rootRunId: text.optional(),\n memo: z.record(z.string(), z.unknown()).optional(),\n })\n .strict()\n .optional(),\n groupBy: z\n .array(z.enum(['STATUS', 'WORKFLOW_KEY', 'EXECUTION_KIND', 'TASK_QUEUE']))\n .max(2)\n .optional(),\n },\n read,\n (args) => request(ops.RUNS_COUNT, args, 'workflowRunsCount'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_history'),\n 'Run History Page',\n 'Read one bounded history page. Pass nextAfter as after; offloaded payload URLs are returned, not fetched.',\n {\n run,\n after: z.number().int().nonnegative().optional(),\n limit: z.number().int().min(1).max(1000).optional(),\n },\n read,\n ({ run: ref, ...options }) =>\n request(\n typeof ref === 'string' ? ops.RUN_HISTORY : ops.RUN_HISTORY_BY_TARGET,\n { ...(typeof ref === 'string' ? { runId: ref } : { target: ref }), ...options },\n 'workflowRunHistory',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_signal'),\n 'Signal Run',\n 'Send a signal, potentially resuming a workflow and external actions. Use an idempotencyKey for safe retries. Gateway execute permission and feature gates apply.',\n { run, name: text, payload: z.unknown().optional(), idempotencyKey: text.optional() },\n destructive,\n ({ run: ref, ...input }) =>\n request(\n typeof ref === 'string' ? ops.SIGNAL_RUN : ops.SIGNAL_RUN_BY_TARGET,\n { ...(typeof ref === 'string' ? { runId: ref } : { target: ref }), ...input },\n 'signalWorkflowRun',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_stack_trace'),\n 'Run Stack Trace',\n 'Read the current replayed stack trace. Enhanced traces and optional metadata describe current execution; metadata and workflow-ID targets require durable parity.',\n { run, enhanced: z.boolean().optional(), metadata: z.boolean().optional() },\n read,\n ({ run: ref, enhanced, metadata }) =>\n request(\n typeof ref !== 'string' || metadata ? ops.RUN_STACK_TRACE_PARITY : ops.RUN_STACK_TRACE,\n {\n ...(typeof ref === 'string' ? { runId: ref } : { target: ref }),\n enhanced,\n ...(metadata ? { metadata } : {}),\n },\n 'workflowRunStackTrace',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_determinism'),\n 'Run Determinism Status',\n 'Read whether workflow tasks keep failing and why, without changing run state.',\n { runId: text },\n read,\n (args) => request(ops.RUN_DETERMINISM_STATUS, args, 'workflowRunDeterminismStatus'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'runs_terminate'),\n 'Terminate Run',\n 'Immediately stop a run without cancellation handlers. This is destructive and requires gateway workflow-run delete permission.',\n { run, reason: z.string().optional() },\n destructive,\n ({ run: ref, reason }) =>\n request(\n typeof ref === 'string' ? ops.TERMINATE_RUN : ops.TERMINATE_RUN_BY_TARGET,\n { ...(typeof ref === 'string' ? { runId: ref } : { target: ref }), reason },\n 'terminateWorkflowRun',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_start'),\n 'Start Durable Workflow',\n 'Start a durable workflow, which may execute external actions. Confirm intent before calling. TERMINATE_EXISTING terminates the open run and uses the separate delete-permission gateway operation. Parity options require durable parity.',\n startShape,\n destructive,\n ({ memo, completionCallback, ...input }) => {\n const terminate = input.idConflictPolicy === 'TERMINATE_EXISTING';\n if (terminate && !input.workflowId)\n throw new McpUserError('TERMINATE_EXISTING requires workflowId');\n const parity =\n Object.keys(input).some(\n (key) =>\n ![\n 'workflowKey',\n 'version',\n 'workflowFn',\n 'input',\n 'signals',\n 'idempotencyKey',\n ].includes(key),\n ) ||\n memo !== undefined ||\n completionCallback !== undefined;\n return request(\n terminate\n ? ops.START_WORKFLOW_TERMINATE_EXISTING\n : parity\n ? ops.START_WORKFLOW_PARITY\n : ops.START_WORKFLOW,\n {\n input: definedInput({\n ...input,\n context: memo,\n completionCallbackUrl: completionCallback?.url,\n completionCallbackHeaders: completionCallback?.headers,\n completionCallbackSigningSecret: completionCallback?.signingSecret,\n }),\n },\n terminate ? 'startWorkflowTerminateExisting' : 'startWorkflow',\n );\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_export'),\n 'Export Workflow',\n 'Read a portable workflow document or generated code with a fidelity report. Returned file URLs are not downloaded.',\n {\n workflowKey: text,\n version: text.optional(),\n format: z.enum(['JSON', 'TYPESCRIPT', 'PYTHON', 'YAML', 'BUNDLE']).optional(),\n options: z\n .object({\n connectionNames: z.boolean().optional(),\n connectionNameMap: z.record(z.string(), z.string()).optional(),\n includeLayout: z.boolean().optional(),\n includePinnedData: z.boolean().optional(),\n })\n .strict()\n .optional(),\n },\n read,\n (args) => request(ops.EXPORT_WORKFLOW, args, 'exportWorkflow'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_interface'),\n 'Workflow Interface',\n 'Read the typed interface of a workflow version; null when none exists.',\n { workflowKey: text, version: text.optional() },\n read,\n (args) => request(ops.WORKFLOW_INTERFACE, args, 'workflowInterface'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_validate'),\n 'Validate Workflow',\n 'Validate definition JSON without saving or executing it. strict adds code-authored IR rules.',\n { definitionJson: json, strict: z.boolean().optional() },\n read,\n (args) => request(ops.VALIDATE_WORKFLOW_DEFINITION, args, 'validateWorkflowDefinition'),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_create_version'),\n 'Create Workflow Version',\n 'Add a workflow version without running it. Preserve baseVersion/expectedRevision/editSessionId for optimistic concurrency.',\n {\n workflowKey: text,\n definitionJson: json,\n version: text.optional(),\n description: z.string().optional(),\n alias: text.optional(),\n baseVersion: text.optional(),\n expectedRevision: z.number().int().nonnegative().optional(),\n editSessionId: text.optional(),\n interface: z.unknown().optional(),\n authoring: z.unknown().optional(),\n },\n write,\n ({ workflowKey, ...input }) =>\n request(\n ops.CREATE_WORKFLOW_VERSION,\n { workflowKey, input: definedInput(input) },\n 'createWorkflowVersion',\n ),\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_import'),\n 'Import Workflow',\n 'Create a DRAFT from exactly one of definitionJson or inline source files. The service validates/builds source; no workflow is started. Never put literal credentials in imported source.',\n {\n name: text,\n definitionJson: json.optional(),\n source: z\n .object({\n format: z.enum(['JSON', 'TYPESCRIPT']),\n files: z.array(z.object({ path: text, content: z.string() }).strict()).min(1),\n connections: z\n .record(z.string(), z.object({ connectionId: text, adapter: text.optional() }).strict())\n .optional(),\n })\n .strict()\n .optional(),\n workflowKey: text.optional(),\n version: text.optional(),\n description: z.string().optional(),\n alias: text.optional(),\n context: z.unknown().optional(),\n tags: z.array(z.string()).optional(),\n tagsV2: z.unknown().optional(),\n icon: z.string().optional(),\n category: z.string().optional(),\n nodeMappings: z.unknown().optional(),\n allowMissingNodes: z.boolean().optional(),\n },\n write,\n (input) => {\n if ((input.definitionJson === undefined) === (input.source === undefined))\n throw new McpUserError('Import requires exactly one of definitionJson or source');\n return request(ops.IMPORT_WORKFLOW, { input: definedInput(input) }, 'importWorkflow');\n },\n );\n\n tool(\n mcpToolName(ctx.productName, 'workflows_import_template'),\n 'Import Workflow Template',\n 'Import a store template as a DRAFT workflow. This does not purchase a template, activate it or run it.',\n {\n name: text,\n definitionJson: json,\n sourceTemplateId: text,\n sourceTemplateName: z.string().optional(),\n workflowKey: text.optional(),\n description: z.string().optional(),\n category: z.string().optional(),\n icon: z.string().optional(),\n tags: z.array(z.string()).optional(),\n projectId: text.optional(),\n context: z.unknown().optional(),\n },\n write,\n (input) =>\n request(\n ops.IMPORT_WORKFLOW_TEMPLATE,\n { input: definedInput(input) },\n 'importWorkflowTemplate',\n ),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CREATE_SCHEDULED_JOB,\n DELETE_SCHEDULED_JOB,\n GET_SCHEDULED_JOB,\n LIST_SCHEDULED_JOBS,\n UPDATE_SCHEDULED_JOB,\n} from '../operations.js';\nimport { definedInput, runTool, workflowPagination } from './helpers.js';\n\nexport function registerScheduledJobTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_list')),\n {\n title: 'List Scheduled Jobs',\n description: 'List schedules that trigger workflows on a cron or interval.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n enabled: z.boolean().optional().describe('Filter by enabled state'),\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n limit: z.number().optional().describe('Max results'),\n offset: z.number().optional().describe('Offset for pagination'),\n },\n },\n async ({ enabled, workflowKey, limit, offset }) =>\n runTool(ctx, 'scheduled_jobs_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowScheduledJobs: unknown }>(\n LIST_SCHEDULED_JOBS,\n { enabled, workflowKey, pagination: workflowPagination(limit, offset) },\n );\n return jsonResult(data.workflowScheduledJobs);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_get')),\n {\n title: 'Get Scheduled Job',\n description: 'Get one scheduled job by ID.',\n annotations: { readOnlyHint: true },\n inputSchema: { jobId: z.string().describe('Scheduled job ID') },\n },\n async ({ jobId }) =>\n runTool(ctx, 'scheduled_jobs_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowScheduledJob: unknown }>(\n GET_SCHEDULED_JOB,\n { jobId },\n );\n return jsonResult(data.workflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_create')),\n {\n title: 'Create Scheduled Job',\n description:\n 'Schedule a workflow. `schedule` is the cron or interval expression the scheduler service evaluates.',\n inputSchema: {\n name: z.string().describe('Job name'),\n workflowKey: z.string().describe('Workflow key to run'),\n version: z.string().describe('Workflow version'),\n schedule: z.string().describe('Cron or interval expression'),\n enabled: z.boolean().optional().describe('Start enabled (default true)'),\n config: z.unknown().optional().describe('Job config as JSON'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async (args) =>\n runTool(ctx, 'scheduled_jobs_create', async () => {\n const data = await ctx.gql.workspace.request<{ createWorkflowScheduledJob: unknown }>(\n CREATE_SCHEDULED_JOB,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createWorkflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_update')),\n {\n title: 'Update Scheduled Job',\n description: 'Update a scheduled job’s name, schedule, config or enabled state.',\n inputSchema: {\n jobId: z.string().describe('Scheduled job ID'),\n name: z.string().optional().describe('Name'),\n schedule: z.string().optional().describe('Cron or interval expression'),\n enabled: z.boolean().optional().describe('Enabled state'),\n config: z.unknown().optional().describe('Job config as JSON'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ jobId, ...input }) =>\n runTool(ctx, 'scheduled_jobs_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateWorkflowScheduledJob: unknown }>(\n UPDATE_SCHEDULED_JOB,\n { jobId, input: definedInput(input) },\n );\n return jsonResult(data.updateWorkflowScheduledJob);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'scheduled_jobs_delete')),\n {\n title: 'Delete Scheduled Job',\n description: 'Delete a scheduled job permanently.',\n annotations: { destructiveHint: true },\n inputSchema: { jobId: z.string().describe('Scheduled job ID') },\n },\n async ({ jobId }) =>\n runTool(ctx, 'scheduled_jobs_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteWorkflowScheduledJob: unknown }>(\n DELETE_SCHEDULED_JOB,\n { jobId },\n );\n return jsonResult(data.deleteWorkflowScheduledJob);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n CREATE_WEBHOOK,\n DELETE_WEBHOOK,\n GET_WEBHOOK,\n LIST_WEBHOOKS,\n TOGGLE_WEBHOOK,\n UPDATE_WEBHOOK,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\n// Webhooks are EventRegistrations on the deployed schema — there is no\n// `Webhook` type with workflowId/path/method, which is what the pre-BOFF-7084\n// documents assumed.\nconst EventStatusEnum = z.enum(['ACTIVE', 'ARCHIVED', 'DISABLED', 'PAUSED']);\n\nexport function registerWebhookTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_list')),\n {\n title: 'List Webhooks',\n description: 'List event registrations (webhooks) that can trigger workflows.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n status: EventStatusEnum.optional().describe('Filter by status'),\n workflowKey: z.string().optional().describe('Filter by workflow key'),\n },\n },\n async ({ status, workflowKey }) =>\n runTool(ctx, 'webhooks_list', async () => {\n const data = await ctx.gql.workspace.request<{ eventRegistrations: unknown }>(\n LIST_WEBHOOKS,\n { status, workflowKey },\n );\n return jsonResult(data.eventRegistrations);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_get')),\n {\n title: 'Get Webhook',\n description: 'Get one event registration by ID.',\n annotations: { readOnlyHint: true },\n inputSchema: { id: z.string().describe('Event registration ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'webhooks_get', async () => {\n const data = await ctx.gql.workspace.request<{ eventRegistration: unknown }>(GET_WEBHOOK, {\n id,\n });\n return jsonResult(data.eventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_create')),\n {\n title: 'Create Webhook',\n description:\n 'Register an event source that triggers a workflow. triggerNodeId names the trigger node the event enters at. eventSource and eventType are required by the server schema (CreateEventRegistrationInput!); marking them optional in the tool wrapper produced a \"Field eventSource of required type String! was not provided\" error on every call (BOFF-8204).',\n inputSchema: {\n name: z.string().describe('Registration name'),\n workflowKey: z.string().describe('Workflow key to trigger'),\n triggerNodeId: z.string().describe('Trigger node ID'),\n eventSource: z.string().describe('Event source identifier'),\n eventType: z.string().describe('Event type'),\n description: z.string().optional().describe('Description'),\n config: z.unknown().optional().describe('Source-specific config as JSON'),\n payloadMapping: z.unknown().optional().describe('Payload mapping as JSON'),\n validationMethod: z.string().optional().describe('Signature validation method'),\n signatureHeader: z.string().optional().describe('Header carrying the signature'),\n apiKeyHeader: z.string().optional().describe('Header carrying the API key'),\n secretToken: z.string().optional().describe('Shared secret for validation'),\n projectId: z.string().optional().describe('Owning project ID'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async (args) =>\n runTool(ctx, 'webhooks_create', async () => {\n const data = await ctx.gql.workspace.request<{ createEventRegistration: unknown }>(\n CREATE_WEBHOOK,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_update')),\n {\n title: 'Update Webhook',\n description: 'Update an event registration.',\n inputSchema: {\n id: z.string().describe('Event registration ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n status: EventStatusEnum.optional().describe('Status'),\n isActive: z.boolean().optional().describe('Active flag'),\n config: z.unknown().optional().describe('Config as JSON'),\n payloadMapping: z.unknown().optional().describe('Payload mapping as JSON'),\n validationMethod: z.string().optional().describe('Signature validation method'),\n secretToken: z.string().optional().describe('Shared secret'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'webhooks_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateEventRegistration: unknown }>(\n UPDATE_WEBHOOK,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_toggle')),\n {\n title: 'Toggle Webhook',\n description: 'Enable or disable an event registration without deleting it.',\n inputSchema: {\n id: z.string().describe('Event registration ID'),\n isActive: z.boolean().describe('True to enable, false to disable'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id, isActive }) =>\n runTool(ctx, 'webhooks_toggle', async () => {\n const data = await ctx.gql.workspace.request<{ toggleEventRegistration: unknown }>(\n TOGGLE_WEBHOOK,\n { id, isActive },\n );\n return jsonResult(data.toggleEventRegistration);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'webhooks_delete')),\n {\n title: 'Delete Webhook',\n description: 'Delete an event registration permanently.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Event registration ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'webhooks_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteEventRegistration: unknown }>(\n DELETE_WEBHOOK,\n { id },\n );\n return jsonResult(data.deleteEventRegistration);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, mcpToolName, type McpContext } from '../../../core/index.js';\nimport {\n ACTIVATE_WORKFLOW,\n ARCHIVE_WORKFLOW,\n CREATE_WORKFLOW,\n DEACTIVATE_WORKFLOW,\n DELETE_WORKFLOW,\n DUPLICATE_WORKFLOW,\n GET_WORKFLOW,\n GET_WORKFLOW_VERSIONS,\n LIST_WORKFLOWS,\n PUBLISH_WORKFLOW,\n TRIGGER_WORKFLOW,\n UPDATE_WORKFLOW,\n} from '../operations.js';\nimport { definedInput, runTool } from './helpers.js';\n\nconst WorkflowStatusEnum = z.enum(['ACTIVE', 'ARCHIVED', 'DEPRECATED', 'DRAFT']);\n\nexport function registerWorkflowTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_list')),\n {\n title: 'List Workflows',\n description:\n 'List FluidGrids workflow definitions with optional filters and pagination. Use latestOnly to collapse a workflowKey to its newest version.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n status: WorkflowStatusEnum.optional().describe('Filter by workflow status'),\n category: z.string().optional().describe('Filter by category'),\n tags: z.array(z.string()).optional().describe('Filter by tags'),\n latestOnly: z\n .boolean()\n .optional()\n .describe('Return only the latest version per workflowKey'),\n limit: z.number().optional().describe('Max results (default 10)'),\n offset: z.number().optional().describe('Offset for pagination (default 0)'),\n },\n },\n async ({ status, category, tags, latestOnly, limit, offset }) =>\n runTool(ctx, 'workflows_list', async () => {\n const data = await ctx.gql.workspace.request<{ workflowDefinitions: unknown }>(\n LIST_WORKFLOWS,\n { input: definedInput({ status, category, tags, latestOnly, limit, offset }) },\n );\n return jsonResult(data.workflowDefinitions);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_get')),\n {\n title: 'Get Workflow',\n description:\n 'Get a single workflow definition by id, or by workflowKey (optionally pinned to a version). Without a version the executable version is resolved.',\n annotations: { readOnlyHint: true },\n inputSchema: {\n id: z.string().optional().describe('Workflow definition ID'),\n workflowKey: z.string().optional().describe('Workflow key (alternative to id)'),\n version: z.string().optional().describe('Pin to a specific version'),\n },\n },\n async ({ id, workflowKey, version }) =>\n runTool(ctx, 'workflows_get', async () => {\n const data = await ctx.gql.workspace.request<{ workflowDefinition: unknown }>(\n GET_WORKFLOW,\n {\n id,\n workflowKey,\n version,\n },\n );\n return jsonResult(data.workflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_versions')),\n {\n title: 'List Workflow Versions',\n description: 'List every stored version of one workflowKey.',\n annotations: { readOnlyHint: true },\n inputSchema: { workflowKey: z.string().describe('Workflow key') },\n },\n async ({ workflowKey }) =>\n runTool(ctx, 'workflows_versions', async () => {\n const data = await ctx.gql.workspace.request<{ workflowVersions: unknown }>(\n GET_WORKFLOW_VERSIONS,\n { workflowKey },\n );\n return jsonResult(data.workflowVersions);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_create')),\n {\n title: 'Create Workflow',\n description:\n 'Create a workflow definition. definitionJson is the node/edge graph; workflowKey plus version identify it.',\n inputSchema: {\n workflowKey: z.string().describe('Stable key identifying the workflow'),\n name: z.string().describe('Human-readable name'),\n version: z.string().describe('Version string, e.g. \"1.0.0\"'),\n definitionJson: z.unknown().describe('Workflow graph (nodes + edges) as JSON'),\n description: z.string().optional().describe('Description'),\n category: z.string().optional().describe('Category'),\n icon: z.string().optional().describe('Icon identifier'),\n alias: z.string().optional().describe('Alias'),\n projectId: z.string().optional().describe('Owning project ID'),\n context: z.unknown().optional().describe('Context JSON'),\n tags: z.array(z.string()).optional().describe('Tags'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async (args) =>\n runTool(ctx, 'workflows_create', async () => {\n const data = await ctx.gql.workspace.request<{ createWorkflowDefinition: unknown }>(\n CREATE_WORKFLOW,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.createWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_update')),\n {\n title: 'Update Workflow',\n description:\n 'Update a workflow definition by id. Saving a change to a published workflow forks a new version rather than mutating the active one.',\n inputSchema: {\n id: z.string().describe('Workflow definition ID'),\n name: z.string().optional().describe('Name'),\n description: z.string().optional().describe('Description'),\n definitionJson: z.unknown().optional().describe('Workflow graph as JSON'),\n category: z.string().optional().describe('Category'),\n icon: z.string().optional().describe('Icon identifier'),\n alias: z.string().optional().describe('Alias'),\n context: z.unknown().optional().describe('Context JSON'),\n tags: z.array(z.string()).optional().describe('Tags'),\n version: z.string().optional().describe('Version'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id, ...input }) =>\n runTool(ctx, 'workflows_update', async () => {\n const data = await ctx.gql.workspace.request<{ updateWorkflowDefinition: unknown }>(\n UPDATE_WORKFLOW,\n { id, input: definedInput(input) },\n );\n return jsonResult(data.updateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_delete')),\n {\n title: 'Delete Workflow',\n description:\n 'Delete a workflow by key. Without a version every version of that key is deleted.',\n annotations: { destructiveHint: true },\n inputSchema: {\n workflowKey: z.string().describe('Workflow key'),\n version: z.string().optional().describe('Delete only this version'),\n },\n },\n async ({ workflowKey, version }) =>\n runTool(ctx, 'workflows_delete', async () => {\n const data = await ctx.gql.workspace.request<{ deleteWorkflowDefinition: unknown }>(\n DELETE_WORKFLOW,\n { workflowKey, version },\n );\n return jsonResult(data.deleteWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_trigger')),\n {\n title: 'Trigger Workflow',\n description:\n 'Start a workflow run. triggerNodeId names the trigger node to start from; stopAtNodeId runs only up to a node (step debugging).',\n inputSchema: {\n workflowKey: z.string().describe('Workflow key'),\n version: z.string().describe('Workflow version'),\n triggerNodeId: z.string().describe('ID of the trigger node to start from'),\n triggerData: z.unknown().optional().describe('Payload passed to the trigger node'),\n context: z.unknown().optional().describe('Run context JSON'),\n stopAtNodeId: z\n .string()\n .optional()\n .describe('Stop after this node and mark the run COMPLETED'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },\n },\n async (args) =>\n runTool(ctx, 'workflows_trigger', async () => {\n const data = await ctx.gql.workspace.request<{ triggerWorkflow: unknown }>(\n TRIGGER_WORKFLOW,\n { input: definedInput({ ...args }) },\n );\n return jsonResult(data.triggerWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_publish')),\n {\n title: 'Publish Workflow',\n description: 'Publish a workflow definition, making that version the executable one.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_publish', async () => {\n const data = await ctx.gql.workspace.request<{ publishWorkflow: unknown }>(\n PUBLISH_WORKFLOW,\n { id },\n );\n return jsonResult(data.publishWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_activate')),\n {\n title: 'Activate Workflow',\n description:\n 'Activate a workflow definition. Exactly one version per workflowKey may be ACTIVE.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_activate', async () => {\n const data = await ctx.gql.workspace.request<{ activateWorkflowDefinition: unknown }>(\n ACTIVATE_WORKFLOW,\n { id },\n );\n return jsonResult(data.activateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_deactivate')),\n {\n title: 'Deactivate Workflow',\n description: 'Deactivate a workflow definition so no version of the key is executable.',\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_deactivate', async () => {\n const data = await ctx.gql.workspace.request<{ deactivateWorkflowDefinition: unknown }>(\n DEACTIVATE_WORKFLOW,\n { id },\n );\n return jsonResult(data.deactivateWorkflowDefinition);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_duplicate')),\n {\n title: 'Duplicate Workflow',\n description: 'Copy an existing workflow version to a new workflowKey.',\n inputSchema: {\n workflowKey: z.string().describe('Source workflow key'),\n version: z.string().describe('Source version'),\n newWorkflowKey: z.string().describe('Key for the copy'),\n newVersion: z.string().optional().describe('Version for the copy'),\n },\n annotations: { readOnlyHint: false, destructiveHint: false },\n },\n async ({ workflowKey, version, newWorkflowKey, newVersion }) =>\n runTool(ctx, 'workflows_duplicate', async () => {\n const data = await ctx.gql.workspace.request<{ duplicateWorkflow: unknown }>(\n DUPLICATE_WORKFLOW,\n { workflowKey, version, input: definedInput({ newWorkflowKey, newVersion }) },\n );\n return jsonResult(data.duplicateWorkflow);\n }),\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'workflows_archive')),\n {\n title: 'Archive Workflow',\n description: 'Archive a workflow definition. Reversible: archived workflows still list.',\n annotations: { destructiveHint: true },\n inputSchema: { id: z.string().describe('Workflow definition ID') },\n },\n async ({ id }) =>\n runTool(ctx, 'workflows_archive', async () => {\n const data = await ctx.gql.workspace.request<{ archiveWorkflow: unknown }>(\n ARCHIVE_WORKFLOW,\n { id },\n );\n return jsonResult(data.archiveWorkflow);\n }),\n );\n}\n","import { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpPromptName, type McpContext } from '../../core/index.js';\n\n/**\n * FluidGrids MCP prompts — guided multi-step workflows. Names are\n * product-prefixed via mcpPromptName and tracked at function entry.\n */\nexport function registerFluidgridsPrompts(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n const p = ctx.productName;\n const buildName = track(mcpPromptName(p, 'build-workflow'));\n const debugName = track(mcpPromptName(p, 'debug-run'));\n\n // <product>-build-workflow — author, publish and trigger a workflow\n server.registerPrompt(\n buildName,\n {\n title: 'Build a Workflow',\n description:\n 'Guide for authoring a FluidGrids workflow end to end: pick nodes, create the definition, publish a version, then trigger it and confirm the run completes.',\n argsSchema: {\n goal: z.string().optional().describe('What the workflow should do'),\n workflowKey: z.string().optional().describe('Workflow key to use'),\n },\n },\n ({ goal, workflowKey }) => {\n ctx.logger.debug(`Prompt ${buildName} called`, { goal, workflowKey });\n const goalNote = goal\n ? `The workflow should: ${goal}`\n : 'Ask the user what the workflow should do before building anything.';\n const keyNote = workflowKey\n ? `Use the workflowKey \"${workflowKey}\".`\n : 'Choose a stable, descriptive workflowKey and confirm it with the user.';\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Build a FluidGrids workflow.\n\n${goalNote}\n${keyNote}\n\nFollow this order and stop if a step fails:\n\n1. \\`${p}_nodes_list\\` — find the node types you need. Use \\`${p}_nodes_get\\` to read a\n node's input fields before wiring it; do not guess field names.\n2. \\`${p}_workflows_create\\` — build \\`definitionJson\\` as a graph of nodes and edges.\n Exactly one trigger node. Note its node id: triggering needs it.\n3. \\`${p}_workflows_publish\\` then \\`${p}_workflows_activate\\` — only an active version\n is executable, and only one version per key may be ACTIVE.\n4. \\`${p}_workflows_trigger\\` — pass \\`triggerNodeId\\` and any \\`triggerData\\`.\n5. \\`${p}_runs_get\\` — poll until status is terminal (COMPLETED, FAILED, CANCELLED or\n TERMINATED). Statuses are UPPERCASE.\n6. If it did not complete, run \\`${p}_debug-run\\` on the run id.\n\nIf the workflow needs credentials, create them with \\`${p}_credentials_create\\` and\nverify with \\`${p}_credentials_test\\` BEFORE triggering — a missing connection fails\nthe run at the node, not at save time.`,\n },\n },\n ],\n };\n },\n );\n\n // <product>-debug-run — diagnose a failed run\n server.registerPrompt(\n debugName,\n {\n title: 'Debug a Run',\n description:\n 'Guide for diagnosing a FluidGrids run that failed or stalled: read node state, read the log, then retry the failing node or fix the definition.',\n argsSchema: { runId: z.string().optional().describe('Run ID to diagnose') },\n },\n ({ runId }) => {\n ctx.logger.debug(`Prompt ${debugName} called`, { runId });\n const runNote = runId\n ? `Diagnose run \"${runId}\".`\n : `Ask for the run id, or find it with \\`${p}_runs_list\\` filtered to status FAILED.`;\n return {\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: `Diagnose a FluidGrids run.\n\n${runNote}\n\n1. \\`${p}_runs_get\\` — read the run and its per-node state. Identify the FIRST node that\n did not succeed; later failures are usually consequences of it.\n2. \\`${p}_runs_logs\\` — read that node's log with \\`nodeId\\` set, \\`minLevel\\` ERROR first,\n then widen to WARN/INFO if the error alone is not conclusive.\n3. Classify before acting:\n - credential/auth error -> \\`${p}_credentials_test\\` the connection the node uses\n - bad input -> compare against \\`${p}_nodes_get\\` input fields for that node type\n - transient/upstream -> \\`${p}_runs_retry_node\\` is appropriate\n - wrong graph -> fix \\`definitionJson\\` via \\`${p}_workflows_update\\` (this forks a new\n version), then publish, activate and trigger again\n4. Only retry once you know which class it is. Retrying a bad definition just\n reproduces the failure.\n\nA run stuck in WAITING is not failed — it is blocked on a Wait node. Resume it with\n\\`${p}_runs_resume\\` and the payload it expects.`,\n },\n },\n ],\n };\n },\n );\n}\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResourceUri, type McpContext } from '../../core/index.js';\nimport { LIST_NODES } from './operations.js';\nimport { safeErrorMessage } from './tools/helpers.js';\n\n/**\n * Read-only FluidGrids MCP resources. URIs are product-prefixed via\n * mcpResourceUri so they don't collide when multiple MCP servers run side by\n * side. Each is tracked at function entry so the shell manifest reflects what\n * was registered even though registration is imperative.\n */\nexport function registerFluidgridsResources(\n server: McpServer,\n ctx: McpContext,\n track: (uri: string) => string,\n): void {\n const schemaUri = track(mcpResourceUri(ctx.productName, 'schema'));\n const nodesUri = track(mcpResourceUri(ctx.productName, 'nodes'));\n\n // <product>://schema — domain overview\n server.registerResource(\n 'fluidgrids-schema',\n schemaUri,\n {\n title: 'FluidGrids Domain Schema',\n description:\n 'Overview of the FluidGrids workflow-automation domain — entities, enums, and the per-entity tool surface.',\n mimeType: 'text/plain',\n },\n async () => {\n ctx.logger.debug(`Resource ${schemaUri} requested`);\n const schema = `# FluidGrids Domain (Overview)\n\nVisual workflow automation. A workflow is a graph of nodes; running one produces a run.\n\n## Core entities\n- WorkflowDefinition — identified by (workflowKey, version). Many versions per key;\n at most ONE is ACTIVE. Saving over a published version forks a new version.\n- WorkflowRun — one execution. Has per-node state and a log stream.\n- NodeEndpointConfig — an available node type at a version (BUILTIN | CUSTOM | STORE).\n- Connection — a stored credential against a Provider. Secrets live in the vault.\n- EventRegistration — an event source (webhook) that triggers a workflow.\n- ScheduledJob — a cron/interval schedule that triggers a workflow.\n\n## Enums\n- WorkflowStatus: ACTIVE | ARCHIVED | DEPRECATED | DRAFT\n- RunStatus: PENDING | RUNNING | WAITING | COMPLETED | FAILED | CANCELLED | TERMINATED\n (UPPERCASE on the wire — comparing lowercase is a known source of hangs)\n- RunLogLevel: DEBUG | INFO | WARN | ERROR\n- PublishType: BUILTIN | CUSTOM | STORE\n- NodeConfigStatus: AVAILABLE | DEPRECATED | DISABLED\n- EventStatus: ACTIVE | PAUSED | DISABLED | ARCHIVED\n\n## Typical sequence\n1. ${ctx.productName}_nodes_list — see what nodes exist\n2. ${ctx.productName}_workflows_create — create a definition with a definitionJson graph\n3. ${ctx.productName}_workflows_publish / _activate — make a version executable\n4. ${ctx.productName}_workflows_trigger — start a run\n5. ${ctx.productName}_runs_get / _runs_logs — follow it to a terminal status\n\n## Tier\nEvery tool here is workspace tier and needs a workspace context. Sign in and\nselect a workspace with the auth tools first.\n`;\n return { contents: [{ uri: schemaUri, mimeType: 'text/plain', text: schema }] };\n },\n );\n\n // <product>://nodes — live node catalogue\n server.registerResource(\n 'fluidgrids-nodes',\n nodesUri,\n {\n title: 'FluidGrids Node Catalogue',\n description:\n 'The node types currently available to build workflows with, read live from the node endpoint config registry.',\n mimeType: 'application/json',\n },\n async () => {\n ctx.logger.debug(`Resource ${nodesUri} requested`);\n try {\n const data = await ctx.gql.workspace.request<{ nodeEndpointConfigs: unknown }>(LIST_NODES, {\n status: 'AVAILABLE',\n });\n return {\n contents: [\n {\n uri: nodesUri,\n mimeType: 'application/json',\n text: JSON.stringify(data.nodeEndpointConfigs, null, 2),\n },\n ],\n };\n } catch (error) {\n // Resources must not throw: an unauthenticated client reading this\n // should see why, not an opaque transport failure.\n const message = safeErrorMessage(error);\n ctx.logger.error('fluidgrids nodes resource failed', { error: message });\n return {\n contents: [\n {\n uri: nodesUri,\n mimeType: 'application/json',\n text: JSON.stringify(\n {\n error: message,\n hint: 'Sign in and select a workspace first — the node registry is workspace-scoped.',\n },\n null,\n 2,\n ),\n },\n ],\n };\n }\n },\n );\n}\n","/**\n * FluidGrids module (BOFF-7088) — the workflow-automation surface of the\n * FluidGrids product: workflows, runs, nodes, credentials, webhooks, scheduled\n * jobs, workflow variables and pinned data, plus read-only dashboard/usage/\n * search/config, run inspection, data tables and static data.\n *\n * Before this module the fluidgrids-mcp shell mounted only generic platform\n * modules (and, by copy-paste, `vibecontrols`), so an MCP client talking to\n * FluidGrids had 600+ tools and not one that could touch a workflow.\n *\n * Every GraphQL document lives in ./operations.ts, ported from `@fluidgrids/sdk`\n * where each one is validated against vendored snapshots of the deployed\n * supergraphs in CI. All of them are workspace tier.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerCredentialTools } from './tools/credentials.js';\nimport { registerDataTools } from './tools/data.js';\nimport { registerInsightTools } from './tools/insights.js';\nimport { registerInspectTools } from './tools/inspect.js';\nimport { registerNodeTools } from './tools/nodes.js';\nimport { registerRunTools } from './tools/runs.js';\nimport { registerDurableTools } from './tools/durable.js';\nimport { registerScheduledJobTools } from './tools/scheduled-jobs.js';\nimport { registerWebhookTools } from './tools/webhooks.js';\nimport { registerWorkflowTools } from './tools/workflows.js';\nimport { registerFluidgridsPrompts } from './prompts.js';\nimport { registerFluidgridsResources } from './resources.js';\n\nconst fluidgridsModule: McpModule = {\n id: 'fluidgrids',\n version: '0.0.1',\n displayName: 'FluidGrids',\n capabilities: { tools: {}, resources: {}, prompts: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const resources: string[] = [];\n const prompts: string[] = [];\n\n const trackTool = (n: string): string => {\n tools.push(n);\n return n;\n };\n const trackResource = (uri: string): string => {\n resources.push(uri);\n return uri;\n };\n const trackPrompt = (n: string): string => {\n prompts.push(n);\n return n;\n };\n\n registerWorkflowTools(server, ctx, trackTool);\n registerRunTools(server, ctx, trackTool);\n registerDurableTools(server, ctx, trackTool);\n registerNodeTools(server, ctx, trackTool);\n registerCredentialTools(server, ctx, trackTool);\n registerWebhookTools(server, ctx, trackTool);\n registerScheduledJobTools(server, ctx, trackTool);\n registerInsightTools(server, ctx, trackTool);\n registerInspectTools(server, ctx, trackTool);\n registerDataTools(server, ctx, trackTool);\n\n registerFluidgridsResources(server, ctx, trackResource);\n registerFluidgridsPrompts(server, ctx, trackPrompt);\n\n return { tools, resources, prompts };\n },\n};\n\nexport default fluidgridsModule;\n"],"mappings":";;;;;AACA,MAAMA,oBAAkB;AACxB,MAAMC,eAAa;;;;;AAKnB,MAAM,gBAAgB,GAAGA,aAAW;;;;AAIpC,MAAM,iBAAiB;;;;;;;AAQvB,MAAa,kBAAkB;;;;;;;;;;AAU/B,MAAa,kBAAkB;;;mCAGID,kBAAgB;;;;;AAKnD,MAAa,2BAA2B;;yEAEiCA,kBAAgB;;;AAGzF,MAAa,0BAA0B;;;mCAGJA,kBAAgB;;;;AAInD,MAAa,+BAA+B;;;;;;;;AAQ5C,MAAa,qBAAqB;;;;;AAKlC,MAAa,iBAAiB;;2CAEaC,aAAW;;;AAGtD,MAAa,wBAAwB;;2CAEM,cAAc;;;AAGzD,MAAa,oCAAoC;;4DAEW,cAAc;;;AAG1E,MAAa,eAAe;mEACuCA,aAAW;;AAE9E,MAAa,qBAAqB;;6GAE2E,cAAc;;;AAG3H,MAAa,cAAc;sFAC2D,eAAe;;AAErG,MAAa,6BAA6B;;iIAEuF,eAAe;;;AAGhJ,MAAa,aAAa;;;;;AAK1B,MAAM,iBAAiB;AACvB,MAAa,cAAc;;wEAE6C,eAAe;;;AAGvF,MAAa,wBAAwB;;0EAEqC,eAAe;;;AAGzF,MAAM,gBAAgB;AACtB,MAAa,aAAa;;0GAEgF,cAAc;;;AAGxH,MAAa,uBAAuB;;4GAEwE,cAAc;;;AAG1H,MAAa,kBAAkB;;;;;AAK/B,MAAa,yBAAyB;;;;;;;AAOtC,MAAa,yBAAyB;;;;;AAKtC,MAAa,gBAAgB;;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