@rolino/mcp 0.4.0 → 0.5.0

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.
package/dist/index.cjs CHANGED
@@ -48,7 +48,7 @@ var z = __toESM(require("zod/v4"), 1);
48
48
  // package.json
49
49
  var package_default = {
50
50
  name: "@rolino/mcp",
51
- version: "0.4.0",
51
+ version: "0.5.0",
52
52
  description: "Model Context Protocol server for Rolino",
53
53
  type: "module",
54
54
  license: "MIT",
@@ -107,9 +107,9 @@ var package_default = {
107
107
  dependencies: {
108
108
  "@hono/node-server": "2.0.12",
109
109
  "@modelcontextprotocol/sdk": "^1.30.0",
110
- "@rolino/contracts": "0.4.0",
111
- "@rolino/local-auth": "0.4.0",
112
- "@rolino/sdk": "0.4.0",
110
+ "@rolino/contracts": "0.5.0",
111
+ "@rolino/local-auth": "0.5.0",
112
+ "@rolino/sdk": "0.5.0",
113
113
  zod: "^4.4.3"
114
114
  },
115
115
  devDependencies: {
@@ -195,7 +195,7 @@ var mcpDraftInputShape = {
195
195
  "TikTok delivery choices. First call refresh_delivery_options, then supply an explicit mode. Direct publishing requires an exact returned visibility plus yes/no choices for comments, duet, stitch, commercial content, own-brand promotion, third-party promotion, and AI-generated content. Set reviewed only after reviewing the account-specific options; this is distinct from draft mutation consent."
196
196
  ),
197
197
  youtubeSettings: import_contracts.DraftPostInputSchema.shape.youtubeSettings.describe(
198
- "Required with YOUTUBE: explicit title, numeric categoryId, privacyStatus, madeForKids declaration, synthetic-media disclosure, subscriber-notification choice, and tags. Unaudited Google API projects may be restricted to Private uploads."
198
+ "Required with YOUTUBE: explicit title, numeric categoryId, privacyStatus, madeForKids declaration, synthetic-media disclosure, subscriber-notification choice, and tags. Immediate publishing uses the exact PUBLIC, UNLISTED, or PRIVATE visibility and creates no schedule. Future scheduling requires PUBLIC, while Rolino uploads privately for preparation. Unaudited Google API projects may be restricted to Private uploads."
199
199
  )
200
200
  };
201
201
  var mcpDraftUpdateInputShape = {
@@ -217,6 +217,8 @@ var mcpScheduleExecuteOutputSchema = z.object({
217
217
  provider: import_contracts.PostSchedulePendingSchema.shape.provider.optional(),
218
218
  mutationId: import_contracts.PostSchedulePendingSchema.shape.mutationId.optional(),
219
219
  operation: import_contracts.PostSchedulePendingSchema.shape.operation.optional(),
220
+ phase: import_contracts.PostSchedulePendingSchema.shape.phase.optional(),
221
+ videoUploaded: import_contracts.PostSchedulePendingSchema.shape.videoUploaded.optional(),
220
222
  message: import_contracts.PostSchedulePendingSchema.shape.message.optional()
221
223
  }).passthrough();
222
224
  function jsonResult(structuredContent) {
@@ -316,6 +318,42 @@ var publishExecuteAnnotations = {
316
318
  idempotentHint: true,
317
319
  openWorldHint: true
318
320
  };
321
+ var destructiveIdempotentAnnotations = {
322
+ readOnlyHint: false,
323
+ destructiveHint: true,
324
+ idempotentHint: true,
325
+ openWorldHint: false
326
+ };
327
+ var revalidationTestAnnotations = {
328
+ readOnlyHint: false,
329
+ destructiveHint: false,
330
+ idempotentHint: true,
331
+ openWorldHint: true
332
+ };
333
+ var blogImageWriteAnnotations = {
334
+ readOnlyHint: false,
335
+ destructiveHint: false,
336
+ idempotentHint: true,
337
+ openWorldHint: false
338
+ };
339
+ var blogConfirmationPreviewAnnotations = {
340
+ readOnlyHint: false,
341
+ destructiveHint: false,
342
+ idempotentHint: false,
343
+ openWorldHint: false
344
+ };
345
+ var blogConfirmedWriteAnnotations = {
346
+ readOnlyHint: false,
347
+ destructiveHint: false,
348
+ idempotentHint: true,
349
+ openWorldHint: false
350
+ };
351
+ var blogScheduleExecuteAnnotations = {
352
+ readOnlyHint: false,
353
+ destructiveHint: false,
354
+ idempotentHint: true,
355
+ openWorldHint: true
356
+ };
319
357
  function defaultClient(options) {
320
358
  return new import_sdk2.RolinoClient({
321
359
  baseUrl: options.baseUrl ?? "https://getrolino.com",
@@ -326,6 +364,10 @@ function defaultClient(options) {
326
364
  }
327
365
  function createRolinoMcpServer(options = {}) {
328
366
  const api = options.client ?? defaultClient(options);
367
+ const blogApi = () => {
368
+ if (!api.blog) throw new TypeError("This Rolino client does not support Blog Studio.");
369
+ return api.blog;
370
+ };
329
371
  const server = new import_mcp.McpServer({
330
372
  name: "rolino",
331
373
  version: ROLINO_MCP_VERSION,
@@ -547,7 +589,7 @@ function createRolinoMcpServer(options = {}) {
547
589
  });
548
590
  server.registerTool("preview_post_schedule", {
549
591
  title: "Preview a Rolino post schedule",
550
- description: "Validate one exact future schedule against the current post version and live provider health. A YouTube schedule must target Public and its preview explains that confirmed execution starts a private upload immediately for early processing. This contacts configured providers and creates a five-minute, single-use confirmation, but does not schedule or publish the post. Inspect the complete result before calling execute_post_schedule with identical values.",
592
+ description: "Validate one exact future schedule against the current post version and live provider health. A YouTube schedule must target Public. Its preview states that preparation uploads the video privately now; CONFIRMING_SCHEDULE means the upload is complete and YouTube is acknowledging the future Public publish time, not that the video is public. This contacts configured providers and creates a five-minute, single-use confirmation, but does not schedule or publish the post. Inspect the complete result before calling execute_post_schedule with identical values.",
551
593
  inputSchema: {
552
594
  projectId: z.string().min(1).describe("Exact Rolino project ID."),
553
595
  postId: z.string().min(1).describe("Exact Rolino post ID."),
@@ -570,7 +612,7 @@ function createRolinoMcpServer(options = {}) {
570
612
  });
571
613
  server.registerTool("execute_post_schedule", {
572
614
  title: "Execute a confirmed Rolino post schedule",
573
- description: "Schedule a post only after preview_post_schedule. Pass the unchanged time, timezone, post version, and returned one-time confirmation token. For YouTube, confirmed execution begins or resumes the private upload immediately and may return PENDING until a remote schedule change is confirmed; it never means the video already published. Rolino rechecks readiness and provider health, rejects stale or mismatched confirmation, and uses the stable idempotency key for safe retries. Scheduling causes future external publishing and is consequential.",
615
+ description: "Schedule a post only after preview_post_schedule. Pass the unchanged time, timezone, post version, and returned one-time confirmation token. For YouTube, confirmed execution begins or resumes a private upload immediately and may return PENDING with phase REMOTE_SCHEDULE_CONFIRMATION after upload while YouTube acknowledges the future Public publish time. PENDING never means the video is public. Rolino rechecks readiness and provider health, rejects stale or mismatched confirmation, and uses the stable idempotency key for safe retries. Scheduling causes future external publishing and is consequential.",
574
616
  inputSchema: {
575
617
  projectId: z.string().min(1).describe("Exact Rolino project ID."),
576
618
  postId: z.string().min(1).describe("Exact Rolino post ID."),
@@ -602,7 +644,7 @@ function createRolinoMcpServer(options = {}) {
602
644
  });
603
645
  server.registerTool("preview_post_publish", {
604
646
  title: "Preview immediate Rolino post publishing",
605
- description: "Validate exact destinations against the current post version, safe retry state, readiness, and live provider health. YouTube readiness requires one stored video and explicit metadata; the configured visibility is exact, while unaudited Google API projects may be restricted to Private. This contacts configured providers and creates a five-minute, single-use confirmation, but does not publish. Inspect the complete result before calling execute_post_publish with identical destinations.",
647
+ description: "Validate exact destinations for immediate publishing against the current post version, safe retry state, readiness, and live provider health. YouTube readiness requires one stored video and explicit metadata. Immediate YouTube publishing uses the configured PUBLIC, UNLISTED, or PRIVATE visibility and never creates a schedule; the preview exposes this as deliveryMode IMMEDIATE. Unaudited Google API projects may be restricted to Private. This contacts configured providers and creates a five-minute, single-use confirmation, but does not publish. Inspect the complete result before calling execute_post_publish with identical destinations.",
606
648
  inputSchema: {
607
649
  projectId: z.string().min(1).describe("Exact Rolino project ID."),
608
650
  postId: z.string().min(1).describe("Exact Rolino post ID."),
@@ -625,7 +667,7 @@ function createRolinoMcpServer(options = {}) {
625
667
  });
626
668
  server.registerTool("execute_post_publish", {
627
669
  title: "Execute confirmed immediate Rolino post publishing",
628
- description: "Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token. Video execution remains PREPARING for YouTube and LinkedIn until provider-confirmed upload and processing complete; no queued or local state is reported as published. Rolino rechecks readiness and safe retry state, durably queues the exact destinations, rejects ambiguous prior outcomes, and uses the stable idempotency key to prevent duplicate execution. This is immediately consequential.",
670
+ description: "Begin external publishing only after preview_post_publish. Pass the unchanged destinations, post version, and returned one-time confirmation token. Immediate YouTube publishing preserves the previewed PUBLIC, UNLISTED, or PRIVATE visibility and never creates or confirms a schedule. Video execution remains PREPARING for YouTube and LinkedIn until provider-confirmed upload and processing complete; no queued or local state is reported as published. Rolino rechecks readiness and safe retry state, durably queues the exact destinations, rejects ambiguous prior outcomes, and uses the stable idempotency key to prevent duplicate execution. This is immediately consequential.",
629
671
  inputSchema: {
630
672
  projectId: z.string().min(1).describe("Exact Rolino project ID."),
631
673
  postId: z.string().min(1).describe("Exact Rolino post ID."),
@@ -689,6 +731,542 @@ function createRolinoMcpServer(options = {}) {
689
731
  return errorResult(error);
690
732
  }
691
733
  });
734
+ server.registerTool("list_seo_opportunities", {
735
+ title: "List active SEO tasks",
736
+ description: "Read a bounded list of active Ready and Research SEO tasks for one exact project. Each result contains one complete versioned task, decision, format, deliverables, evidence, provenance, separate topic-relevance and action-readiness confidence, limits, and no-publish rules. Rejected findings are never active tasks. This closed-world tool cannot run analysis, change settings, delete data, enable reports, send email, publish, generate media, or call an external provider.",
737
+ inputSchema: {
738
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
739
+ limit: z.number().int().min(1).max(50).default(20).describe("Maximum opportunities to return, from 1 to 50."),
740
+ cursor: z.string().min(1).max(512).regex(/^[A-Za-z0-9_-]+$/).optional().describe("Opaque cursor returned by a previous list_seo_opportunities call."),
741
+ kind: import_contracts.SeoOpportunityKindSchema.optional().describe("Optional exact opportunity kind."),
742
+ expectedImpact: import_contracts.SeoExpectedImpactSchema.optional().describe("Optional HIGH, MEDIUM, or LOW impact filter.")
743
+ },
744
+ outputSchema: import_contracts.SeoOpportunityListDataSchema,
745
+ annotations: readOnlyAnnotations
746
+ }, async ({ projectId, limit, cursor, kind, expectedImpact }) => {
747
+ try {
748
+ if (!api.seo) throw new TypeError("This Rolino client does not support SEO reading.");
749
+ return jsonResult(await api.seo.opportunities.list(projectId, { limit, cursor, kind, expectedImpact }));
750
+ } catch (error) {
751
+ return errorResult(error);
752
+ }
753
+ });
754
+ server.registerTool("get_seo_opportunity", {
755
+ title: "Read one complete SEO task",
756
+ description: "Read one canonical versioned SEO task by exact project and opportunity ID. It includes the Ready or Research decision, selected format, exact deliverables, safe evidence, provenance, separate topic-relevance and action-readiness confidence, targeting, source dates, limitations, success metric, and no-publish rules. This closed-world tool is read-only and cannot generate content, publish, or call an external provider.",
757
+ inputSchema: {
758
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
759
+ opportunityId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino SEO opportunity ID.")
760
+ },
761
+ outputSchema: import_contracts.SeoOpportunitySchema,
762
+ annotations: readOnlyAnnotations
763
+ }, async ({ projectId, opportunityId }) => {
764
+ try {
765
+ if (!api.seo) throw new TypeError("This Rolino client does not support SEO reading.");
766
+ return jsonResult(await api.seo.opportunities.get(projectId, opportunityId));
767
+ } catch (error) {
768
+ return errorResult(error);
769
+ }
770
+ });
771
+ server.registerTool("list_seo_reports", {
772
+ title: "List weekly SEO reports",
773
+ description: "Read a bounded list of stored weekly SEO report summaries for one exact project. This closed-world tool is read-only and cannot generate or deliver reports.",
774
+ inputSchema: {
775
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
776
+ limit: z.number().int().min(1).max(26).default(10).describe("Maximum reports to return, from 1 to 26."),
777
+ cursor: z.string().min(1).max(512).regex(/^[A-Za-z0-9_-]+$/).optional().describe("Opaque cursor returned by a previous list_seo_reports call."),
778
+ completeness: import_contracts.SeoReportCompletenessSchema.optional().describe("Optional COMPLETE or PARTIAL filter.")
779
+ },
780
+ outputSchema: import_contracts.SeoReportListDataSchema,
781
+ annotations: readOnlyAnnotations
782
+ }, async ({ projectId, limit, cursor, completeness }) => {
783
+ try {
784
+ if (!api.seo) throw new TypeError("This Rolino client does not support SEO reading.");
785
+ return jsonResult(await api.seo.reports.list(projectId, { limit, cursor, completeness }));
786
+ } catch (error) {
787
+ return errorResult(error);
788
+ }
789
+ });
790
+ server.registerTool("get_seo_report", {
791
+ title: "Read one weekly SEO report",
792
+ description: "Read one unchanged weekly SEO report snapshot by exact project and report ID. It groups complete Ready tasks, Research tasks, and bounded rejected findings. This closed-world tool is read-only and cannot generate content, change, or deliver a report.",
793
+ inputSchema: {
794
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
795
+ reportId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino weekly SEO report ID.")
796
+ },
797
+ outputSchema: import_contracts.SeoReportSchema,
798
+ annotations: readOnlyAnnotations
799
+ }, async ({ projectId, reportId }) => {
800
+ try {
801
+ if (!api.seo) throw new TypeError("This Rolino client does not support SEO reading.");
802
+ return jsonResult(await api.seo.reports.get(projectId, reportId));
803
+ } catch (error) {
804
+ return errorResult(error);
805
+ }
806
+ });
807
+ server.registerTool("list_blog_plans", {
808
+ title: "List Blog Studio plans",
809
+ description: "Read the bounded 30-day Blog Studio plans for one exact project. This does not read the social calendar.",
810
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID.") },
811
+ outputSchema: z.object({ plans: z.array(import_contracts.AgentBlogPlanSchema) }),
812
+ annotations: readOnlyAnnotations
813
+ }, async ({ projectId }) => {
814
+ try {
815
+ return jsonResult(await blogApi().plans.list(projectId));
816
+ } catch (error) {
817
+ return errorResult(error);
818
+ }
819
+ });
820
+ server.registerTool("get_blog_setup_status", {
821
+ title: "Get Blog setup status",
822
+ description: "Requires blog:read. Call first to inspect action-oriented website, import, plan, delivery, and revalidation readiness. This never returns credentials, secrets, prompts, or draft content.",
823
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema },
824
+ outputSchema: import_contracts.AgentBlogSetupStatusSchema,
825
+ annotations: readOnlyAnnotations
826
+ }, async ({ projectId }) => {
827
+ try {
828
+ return jsonResult(await blogApi().setup.status(projectId));
829
+ } catch (error) {
830
+ return errorResult(error);
831
+ }
832
+ });
833
+ server.registerTool("initialize_blog_site", {
834
+ title: "Initialize and import Blog site",
835
+ description: "Requires blog:manage. Initialize the exact project website from Brand Settings and queue a bounded import. Poll the returned job; do not retry blindly. This cannot publish.",
836
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, idempotencyKey: z.string().min(8).max(200) },
837
+ outputSchema: import_contracts.AgentBlogJobSchema,
838
+ annotations: createDraftAnnotations
839
+ }, async ({ projectId, idempotencyKey }) => {
840
+ try {
841
+ return jsonResult(await blogApi().site.import(projectId, idempotencyKey));
842
+ } catch (error) {
843
+ return errorResult(error);
844
+ }
845
+ });
846
+ server.registerTool("retry_blog_site_import", {
847
+ title: "Retry Blog site import",
848
+ description: "Requires blog:manage. Requeue only a failed bounded website import with a stable idempotency key. Poll the returned job.",
849
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, idempotencyKey: z.string().min(8).max(200) },
850
+ outputSchema: import_contracts.AgentBlogJobSchema,
851
+ annotations: createDraftAnnotations
852
+ }, async ({ projectId, idempotencyKey }) => {
853
+ try {
854
+ return jsonResult(await blogApi().site.retry(projectId, idempotencyKey));
855
+ } catch (error) {
856
+ return errorResult(error);
857
+ }
858
+ });
859
+ server.registerTool("create_blog_plan", {
860
+ title: "Create Blog cadence plan",
861
+ description: "Requires blog:manage. Queue an evidence-backed 30-day plan only after import is ready. Ask the user for cadence first and poll the returned job. This never accepts items or publishes.",
862
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, startsOn: z.string().regex(/^\d{4}-\d{2}-\d{2}$/), weekdays: z.array(z.number().int().min(0).max(6)).min(1).max(7), timeZone: z.string().min(1), idempotencyKey: z.string().min(8).max(200) },
863
+ outputSchema: z.object({ planId: z.string(), job: import_contracts.AgentBlogJobSchema }),
864
+ annotations: createDraftAnnotations
865
+ }, async ({ projectId, startsOn, weekdays, timeZone, idempotencyKey }) => {
866
+ try {
867
+ return jsonResult(await blogApi().plans.create(projectId, { startsOn, weekdays, timeZone }, idempotencyKey));
868
+ } catch (error) {
869
+ return errorResult(error);
870
+ }
871
+ });
872
+ server.registerTool("retry_blog_plan", {
873
+ title: "Retry failed Blog plan",
874
+ description: "Requires blog:manage. Retry one exact failed plan generation with idempotency and poll the returned job.",
875
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, planId: import_contracts.SeoEntityIdSchema, idempotencyKey: z.string().min(8).max(200) },
876
+ outputSchema: import_contracts.AgentBlogJobSchema,
877
+ annotations: createDraftAnnotations
878
+ }, async ({ projectId, planId, idempotencyKey }) => {
879
+ try {
880
+ return jsonResult(await blogApi().plans.retry(projectId, planId, idempotencyKey));
881
+ } catch (error) {
882
+ return errorResult(error);
883
+ }
884
+ });
885
+ server.registerTool("list_blog_plan_items", {
886
+ title: "List Blog plan items and evidence",
887
+ description: "Requires blog:read. Present this safe frozen evidence to the user before accepting or dismissing any item. Provider payloads and prompts are excluded.",
888
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, planId: import_contracts.SeoEntityIdSchema },
889
+ outputSchema: z.object({ items: z.array(import_contracts.AgentBlogPlanItemSchema) }),
890
+ annotations: readOnlyAnnotations
891
+ }, async ({ projectId, planId }) => {
892
+ try {
893
+ return jsonResult(await blogApi().plans.items.list(projectId, planId));
894
+ } catch (error) {
895
+ return errorResult(error);
896
+ }
897
+ });
898
+ server.registerTool("set_blog_plan_item_state", {
899
+ title: "Accept or dismiss Blog plan item",
900
+ description: "Requires blog:write. Apply an optimistic, idempotent ACCEPTED or DISMISSED transition only after showing the evidence. Dismissal is marked destructive. This cannot publish.",
901
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, planId: import_contracts.SeoEntityIdSchema, itemId: import_contracts.SeoEntityIdSchema, state: z.enum(["ACCEPTED", "DISMISSED"]), expectedState: z.string().min(1), expectedVersion: z.number().int().positive(), idempotencyKey: z.string().min(8).max(200) },
902
+ outputSchema: import_contracts.AgentBlogPlanItemSchema,
903
+ annotations: destructiveIdempotentAnnotations
904
+ }, async ({ projectId, planId, itemId, ...input }) => {
905
+ try {
906
+ return jsonResult(await blogApi().plans.items.setState(projectId, planId, itemId, input));
907
+ } catch (error) {
908
+ return errorResult(error);
909
+ }
910
+ });
911
+ server.registerTool("create_blog_article_from_plan_item", {
912
+ title: "Create editable Blog article",
913
+ description: "Requires blog:write. Create an editable draft from one accepted plan item and queue generation. Publication remains a separate approved-revision preview and execute operation.",
914
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, planId: import_contracts.SeoEntityIdSchema, itemId: import_contracts.SeoEntityIdSchema, expectedVersion: z.number().int().positive(), idempotencyKey: z.string().min(8).max(200) },
915
+ outputSchema: z.object({ articleId: z.string(), job: import_contracts.AgentBlogJobSchema.nullable() }),
916
+ annotations: createDraftAnnotations
917
+ }, async ({ projectId, planId, itemId, expectedVersion, idempotencyKey }) => {
918
+ try {
919
+ return jsonResult(await blogApi().plans.items.createArticle(projectId, planId, itemId, { expectedState: "ACCEPTED", expectedVersion, idempotencyKey }));
920
+ } catch (error) {
921
+ return errorResult(error);
922
+ }
923
+ });
924
+ server.registerTool("get_blog_connection_status", {
925
+ title: "Get Blog delivery connection status",
926
+ description: "Requires blog:read. Read configured and honestly verified delivery/revalidation readiness. It never returns stored tokens or secrets.",
927
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema },
928
+ outputSchema: import_contracts.AgentBlogConnectionStatusSchema,
929
+ annotations: readOnlyAnnotations
930
+ }, async ({ projectId }) => {
931
+ try {
932
+ return jsonResult(await blogApi().connection.status(projectId));
933
+ } catch (error) {
934
+ return errorResult(error);
935
+ }
936
+ });
937
+ const connectionInputSchema = { projectId: import_contracts.SeoEntityIdSchema, endpoint: z.string().url().nullable(), credentialAction: z.enum(["KEEP", "CREATE", "ROTATE", "REVOKE"]), credentialId: z.string().min(1).nullable(), secretAction: z.enum(["KEEP", "CREATE", "ROTATE"]) };
938
+ server.registerTool("preview_blog_connection_setup", {
939
+ title: "Preview Blog connection setup",
940
+ description: "Requires blog:manage. Preview the exact site, endpoint, credential action, secret action, and effects before provisioning. No delivery token or webhook secret is returned by preview.",
941
+ inputSchema: connectionInputSchema,
942
+ outputSchema: import_contracts.AgentBlogConnectionPreviewSchema,
943
+ annotations: createDraftAnnotations
944
+ }, async ({ projectId, ...input }) => {
945
+ try {
946
+ return jsonResult(await blogApi().connection.preview(projectId, input));
947
+ } catch (error) {
948
+ return errorResult(error);
949
+ }
950
+ });
951
+ server.registerTool("execute_blog_connection_setup", {
952
+ title: "Execute confirmed Blog connection setup",
953
+ description: "Requires blog:manage, the exact preview confirmation, and idempotency. A successful first response can return a delivery token or webhook secret once; write them only to server-side environment configuration. A replay never reveals them again. This cannot publish.",
954
+ inputSchema: { ...connectionInputSchema, confirmationToken: z.string().min(1), idempotencyKey: z.string().min(8).max(200) },
955
+ outputSchema: import_contracts.AgentBlogConnectionExecuteSchema,
956
+ annotations: destructiveIdempotentAnnotations
957
+ }, async ({ projectId, ...input }) => {
958
+ try {
959
+ return jsonResult(await blogApi().connection.execute(projectId, input));
960
+ } catch (error) {
961
+ return errorResult(error);
962
+ }
963
+ });
964
+ server.registerTool("test_blog_revalidation", {
965
+ title: "Test signed Blog revalidation",
966
+ description: "Requires blog:manage. Make one explicit, SSRF-protected open-world signed request to the configured same-host endpoint and persist only a safe status code.",
967
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, idempotencyKey: z.string().min(8).max(200) },
968
+ outputSchema: import_contracts.AgentBlogRevalidationTestSchema,
969
+ annotations: revalidationTestAnnotations
970
+ }, async ({ projectId, idempotencyKey }) => {
971
+ try {
972
+ return jsonResult(await blogApi().connection.test(projectId, idempotencyKey));
973
+ } catch (error) {
974
+ return errorResult(error);
975
+ }
976
+ });
977
+ server.registerTool("list_blog_publishing_providers", {
978
+ title: "List Blog publishing providers",
979
+ description: "List only providers available to this rollout with safe capabilities and official documentation. Requires blog:manage.",
980
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema },
981
+ outputSchema: z.object({ providers: z.array(import_contracts.AgentBlogPublishingProviderSchema) }),
982
+ annotations: readOnlyAnnotations
983
+ }, async ({ projectId }) => {
984
+ try {
985
+ return jsonResult(await blogApi().publishing.providers(projectId));
986
+ } catch (error) {
987
+ return errorResult(error);
988
+ }
989
+ });
990
+ server.registerTool("list_blog_publishing_destinations", {
991
+ title: "List Blog publishing destinations",
992
+ description: "List safe destination readiness without credentials or private provider data.",
993
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema },
994
+ outputSchema: z.object({ destinations: z.array(import_contracts.AgentBlogPublishingDestinationSchema) }),
995
+ annotations: readOnlyAnnotations
996
+ }, async ({ projectId }) => {
997
+ try {
998
+ return jsonResult(await blogApi().publishing.destinations(projectId));
999
+ } catch (error) {
1000
+ return errorResult(error);
1001
+ }
1002
+ });
1003
+ server.registerTool("list_blog_delivery_attempts", {
1004
+ title: "List Blog delivery attempts",
1005
+ description: "List safe per-destination delivery states and remote URLs. Draft content and provider responses are not returned.",
1006
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, articleId: import_contracts.SeoEntityIdSchema.optional() },
1007
+ outputSchema: z.object({ deliveries: z.array(import_contracts.AgentBlogDeliveryAttemptSchema) }),
1008
+ annotations: readOnlyAnnotations
1009
+ }, async ({ projectId, articleId }) => {
1010
+ try {
1011
+ return jsonResult(await blogApi().publishing.deliveries(projectId, articleId));
1012
+ } catch (error) {
1013
+ return errorResult(error);
1014
+ }
1015
+ });
1016
+ server.registerTool("list_blog_articles", {
1017
+ title: "List Blog Studio articles",
1018
+ description: "Read Blog Studio article workflow state for one exact project. Draft content requires blog:read.",
1019
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID.") },
1020
+ outputSchema: z.object({ articles: z.array(import_contracts.AgentBlogArticleSchema) }),
1021
+ annotations: readOnlyAnnotations
1022
+ }, async ({ projectId }) => {
1023
+ try {
1024
+ return jsonResult(await blogApi().articles.list(projectId));
1025
+ } catch (error) {
1026
+ return errorResult(error);
1027
+ }
1028
+ });
1029
+ server.registerTool("get_blog_article", {
1030
+ title: "Read one Blog Studio article",
1031
+ description: "Read one exact Blog Studio draft and its immutable revision history.",
1032
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, articleId: import_contracts.SeoEntityIdSchema },
1033
+ outputSchema: import_contracts.AgentBlogArticleDetailSchema,
1034
+ annotations: readOnlyAnnotations
1035
+ }, async ({ projectId, articleId }) => {
1036
+ try {
1037
+ return jsonResult(await blogApi().articles.get(projectId, articleId));
1038
+ } catch (error) {
1039
+ return errorResult(error);
1040
+ }
1041
+ });
1042
+ server.registerTool("update_blog_draft", {
1043
+ title: "Update one Blog Studio draft",
1044
+ description: "Save a complete Blog draft with optimistic conflict protection. This creates a new immutable revision and cannot publish.",
1045
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, articleId: import_contracts.SeoEntityIdSchema, draft: import_contracts.AgentBlogDraftUpdateSchema },
1046
+ outputSchema: import_contracts.AgentBlogArticleDetailSchema,
1047
+ annotations: createDraftAnnotations
1048
+ }, async ({ projectId, articleId, draft }) => {
1049
+ try {
1050
+ return jsonResult(await blogApi().articles.updateDraft(projectId, articleId, draft));
1051
+ } catch (error) {
1052
+ return errorResult(error);
1053
+ }
1054
+ });
1055
+ server.registerTool("generate_blog_article", {
1056
+ title: "Request Blog article generation",
1057
+ description: "Queue durable generation for one Blog article. It returns a job and never waits for provider work in the request.",
1058
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, articleId: import_contracts.SeoEntityIdSchema, idempotencyKey: z.string().min(8).max(200) },
1059
+ outputSchema: import_contracts.AgentBlogJobSchema,
1060
+ annotations: createDraftAnnotations
1061
+ }, async ({ projectId, articleId, idempotencyKey }) => {
1062
+ try {
1063
+ return jsonResult(await blogApi().articles.generate(projectId, articleId, idempotencyKey));
1064
+ } catch (error) {
1065
+ return errorResult(error);
1066
+ }
1067
+ });
1068
+ server.registerTool("generate_blog_image", {
1069
+ title: "Generate a Blog image candidate",
1070
+ description: "Requires blog:write. Queue a bounded featured-image candidate for one exact article revision. This cannot approve an image or article and cannot publish.",
1071
+ inputSchema: {
1072
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1073
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID."),
1074
+ ...import_contracts.AgentBlogImageGenerateRequestSchema.shape
1075
+ },
1076
+ outputSchema: import_contracts.AgentBlogImageGenerationResponseSchema.shape.data,
1077
+ annotations: blogImageWriteAnnotations
1078
+ }, async ({ projectId, articleId, ...input }) => {
1079
+ try {
1080
+ return jsonResult(await blogApi().articles.generateImage(projectId, articleId, input));
1081
+ } catch (error) {
1082
+ return errorResult(error);
1083
+ }
1084
+ });
1085
+ server.registerTool("upload_blog_image", {
1086
+ title: "Upload a local Blog image candidate",
1087
+ description: "Requires blog:write. Read only one exact caller-supplied local JPEG, PNG, or WebP path and upload it for one exact article revision. This cannot approve an image or article and cannot publish.",
1088
+ inputSchema: {
1089
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1090
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID."),
1091
+ revisionId: import_contracts.AgentBlogImageUploadPrepareRequestSchema.shape.revisionId,
1092
+ filePath: z.string().min(1).describe("Exact local path of the user-approved Blog image."),
1093
+ altText: import_contracts.AgentBlogImageUploadCompleteRequestSchema.shape.altText
1094
+ },
1095
+ outputSchema: import_contracts.AgentBlogImageSchema,
1096
+ annotations: blogImageWriteAnnotations
1097
+ }, async ({ projectId, articleId, revisionId, filePath, altText }) => {
1098
+ try {
1099
+ const absolutePath = (0, import_node_path.resolve)(filePath);
1100
+ const details = await (0, import_promises.stat)(absolutePath).catch(() => null);
1101
+ if (!details?.isFile()) throw new TypeError("The Blog image path must point to a readable file.");
1102
+ const contentTypes = { ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".png": "image/png", ".webp": "image/webp" };
1103
+ const extension = (0, import_node_path.extname)(absolutePath).toLowerCase();
1104
+ const contentType = contentTypes[extension];
1105
+ if (!contentType) throw new TypeError("Use a JPEG, PNG, or WebP Blog image.");
1106
+ const body = await (0, import_node_fs.openAsBlob)(absolutePath, { type: contentType });
1107
+ return jsonResult(await blogApi().articles.uploadImage(projectId, articleId, { revisionId, fileName: (0, import_node_path.basename)(absolutePath), contentType, fileSize: details.size, altText, body }));
1108
+ } catch (error) {
1109
+ return errorResult(error);
1110
+ }
1111
+ });
1112
+ server.registerTool("review_blog_image", {
1113
+ title: "Review a Blog image candidate",
1114
+ description: "Requires blog:write. Approve or reject one exact image version with reviewable alt text and idempotency. This does not approve the article and cannot publish.",
1115
+ inputSchema: {
1116
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1117
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID."),
1118
+ imageId: import_contracts.SeoEntityIdSchema.describe("Exact Blog image ID."),
1119
+ ...import_contracts.AgentBlogImageReviewRequestSchema.shape
1120
+ },
1121
+ outputSchema: import_contracts.AgentBlogImageSchema,
1122
+ annotations: blogImageWriteAnnotations
1123
+ }, async ({ projectId, articleId, imageId, ...input }) => {
1124
+ try {
1125
+ return jsonResult(await blogApi().articles.reviewImage(projectId, articleId, imageId, input));
1126
+ } catch (error) {
1127
+ return errorResult(error);
1128
+ }
1129
+ });
1130
+ server.registerTool("preview_blog_revision_approval", {
1131
+ title: "Preview exact Blog revision approval",
1132
+ description: "Requires blog:approve. Validate one exact revision, its approved image bundle, live links, warnings, and bundle hash, then create a short-lived confirmation. This cannot publish.",
1133
+ inputSchema: {
1134
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1135
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID."),
1136
+ ...import_contracts.AgentBlogApprovalPreviewRequestSchema.shape
1137
+ },
1138
+ outputSchema: import_contracts.AgentBlogApprovalPreviewSchema,
1139
+ annotations: blogConfirmationPreviewAnnotations
1140
+ }, async ({ projectId, articleId, ...input }) => {
1141
+ try {
1142
+ return jsonResult(await blogApi().articles.previewApproval(projectId, articleId, input));
1143
+ } catch (error) {
1144
+ return errorResult(error);
1145
+ }
1146
+ });
1147
+ server.registerTool("execute_blog_revision_approval", {
1148
+ title: "Approve an exact Blog revision bundle",
1149
+ description: "Requires blog:approve. Consume the matching confirmation and idempotently approve the exact revision and image bundle, which makes that bundle eligible for a separate publication operation. This cannot publish.",
1150
+ inputSchema: {
1151
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1152
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID."),
1153
+ ...import_contracts.AgentBlogApprovalExecuteRequestSchema.shape
1154
+ },
1155
+ outputSchema: import_contracts.AgentBlogApprovalExecuteSchema,
1156
+ annotations: blogConfirmedWriteAnnotations
1157
+ }, async ({ projectId, articleId, ...input }) => {
1158
+ try {
1159
+ return jsonResult(await blogApi().articles.executeApproval(projectId, articleId, input));
1160
+ } catch (error) {
1161
+ return errorResult(error);
1162
+ }
1163
+ });
1164
+ server.registerTool("preview_blog_schedule", {
1165
+ title: "Preview an exact Blog schedule",
1166
+ description: "Requires blog:publish. Bind one already-approved exact bundle, future instant, IANA timezone, and destination set to a short-lived confirmation. This does not grant approval or publish now.",
1167
+ inputSchema: {
1168
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1169
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID."),
1170
+ ...import_contracts.AgentBlogSchedulePreviewRequestSchema.shape
1171
+ },
1172
+ outputSchema: import_contracts.AgentBlogSchedulePreviewSchema,
1173
+ annotations: blogConfirmationPreviewAnnotations
1174
+ }, async ({ projectId, articleId, ...input }) => {
1175
+ try {
1176
+ return jsonResult(await blogApi().articles.previewSchedule(projectId, articleId, input));
1177
+ } catch (error) {
1178
+ return errorResult(error);
1179
+ }
1180
+ });
1181
+ server.registerTool("execute_blog_schedule", {
1182
+ title: "Schedule an exact approved Blog bundle",
1183
+ description: "Requires blog:publish. Consume the matching confirmation and idempotently schedule or reschedule one already-approved exact bundle for future external publication. This does not grant approval.",
1184
+ inputSchema: {
1185
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1186
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID."),
1187
+ ...import_contracts.AgentBlogScheduleExecuteRequestSchema.shape
1188
+ },
1189
+ outputSchema: import_contracts.AgentBlogScheduleExecuteSchema,
1190
+ annotations: blogScheduleExecuteAnnotations
1191
+ }, async ({ projectId, articleId, ...input }) => {
1192
+ try {
1193
+ return jsonResult(await blogApi().articles.executeSchedule(projectId, articleId, input));
1194
+ } catch (error) {
1195
+ return errorResult(error);
1196
+ }
1197
+ });
1198
+ server.registerTool("preview_blog_schedule_cancellation", {
1199
+ title: "Preview Blog schedule cancellation",
1200
+ description: "Requires blog:publish. Bind the exact current future schedule to a short-lived cancellation confirmation. This does not unpublish a live article and does not grant approval.",
1201
+ inputSchema: {
1202
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1203
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID.")
1204
+ },
1205
+ outputSchema: import_contracts.AgentBlogScheduleCancelPreviewSchema,
1206
+ annotations: blogConfirmationPreviewAnnotations
1207
+ }, async ({ projectId, articleId }) => {
1208
+ try {
1209
+ return jsonResult(await blogApi().articles.previewScheduleCancellation(projectId, articleId));
1210
+ } catch (error) {
1211
+ return errorResult(error);
1212
+ }
1213
+ });
1214
+ server.registerTool("execute_blog_schedule_cancellation", {
1215
+ title: "Cancel an exact future Blog schedule",
1216
+ description: "Requires blog:publish. Consume the matching confirmation and idempotently cancel the exact future schedule. This is destructive, but it never unpublishes a live article and does not grant approval.",
1217
+ inputSchema: {
1218
+ projectId: import_contracts.SeoEntityIdSchema.describe("Exact Rolino project ID."),
1219
+ articleId: import_contracts.SeoEntityIdSchema.describe("Exact Blog article ID."),
1220
+ ...import_contracts.AgentBlogScheduleCancelExecuteRequestSchema.shape
1221
+ },
1222
+ outputSchema: import_contracts.AgentBlogScheduleCancelExecuteSchema,
1223
+ annotations: destructiveIdempotentAnnotations
1224
+ }, async ({ projectId, articleId, ...input }) => {
1225
+ try {
1226
+ return jsonResult(await blogApi().articles.executeScheduleCancellation(projectId, articleId, input));
1227
+ } catch (error) {
1228
+ return errorResult(error);
1229
+ }
1230
+ });
1231
+ server.registerTool("get_blog_job", {
1232
+ title: "Read one Blog job",
1233
+ description: "Read truthful durable job state without exposing prompts, provider details, or secrets.",
1234
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, jobId: import_contracts.SeoEntityIdSchema },
1235
+ outputSchema: import_contracts.AgentBlogJobSchema,
1236
+ annotations: readOnlyAnnotations
1237
+ }, async ({ projectId, jobId }) => {
1238
+ try {
1239
+ return jsonResult(await blogApi().jobs.get(projectId, jobId));
1240
+ } catch (error) {
1241
+ return errorResult(error);
1242
+ }
1243
+ });
1244
+ server.registerTool("preview_blog_publish", {
1245
+ title: "Preview approved Blog publication",
1246
+ description: "Preview an exact user-approved revision and issue a short-lived bound confirmation. This does not publish.",
1247
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, articleId: import_contracts.SeoEntityIdSchema, revisionId: import_contracts.SeoEntityIdSchema, destinationIds: z.array(import_contracts.SeoEntityIdSchema).min(1).max(20).optional() },
1248
+ outputSchema: import_contracts.AgentBlogPublishPreviewSchema,
1249
+ annotations: publishPreviewAnnotations
1250
+ }, async ({ projectId, articleId, revisionId, destinationIds }) => {
1251
+ try {
1252
+ return jsonResult(await blogApi().articles.previewPublish(projectId, articleId, revisionId, void 0, destinationIds));
1253
+ } catch (error) {
1254
+ return errorResult(error);
1255
+ }
1256
+ });
1257
+ server.registerTool("execute_blog_publish", {
1258
+ title: "Publish approved Blog revision",
1259
+ description: "Publish only the same exact user-approved revision from preview. Requires blog:publish, a confirmation token, and an idempotency key.",
1260
+ inputSchema: { projectId: import_contracts.SeoEntityIdSchema, articleId: import_contracts.SeoEntityIdSchema, revisionId: import_contracts.SeoEntityIdSchema, destinationIds: z.array(import_contracts.SeoEntityIdSchema).min(1).max(20).optional(), confirmationToken: z.string().min(1), idempotencyKey: z.string().min(8).max(200) },
1261
+ outputSchema: z.object({ publicationId: z.string(), articleId: z.string(), revisionId: z.string(), publicUrl: z.string().url(), publishedAt: z.string().datetime() }),
1262
+ annotations: publishExecuteAnnotations
1263
+ }, async ({ projectId, articleId, revisionId, destinationIds, confirmationToken, idempotencyKey }) => {
1264
+ try {
1265
+ return jsonResult(await blogApi().articles.executePublish(projectId, articleId, { revisionId, destinationIds, confirmationToken, idempotencyKey }));
1266
+ } catch (error) {
1267
+ return errorResult(error);
1268
+ }
1269
+ });
692
1270
  server.registerTool("list_calendar_events", {
693
1271
  title: "List Rolino calendar events",
694
1272
  description: "List scheduled posts and their enabled destinations in one exact project, including YouTube posts whose private early preparation has started. By default the bounded window spans 30 days in the past through 90 days ahead; provide both from and to for another range and paginate with nextCursor.",