submit_content_creation
Submit content creation activity drafts to report details like title, description, date, type, metrics, and URL, ensuring accurate activity tracking for Google Developer Experts.
Instructions
Submit a content creation activity draft
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activityDate | Yes | Date published (YYYY-MM-DD format) | |
| activityUrl | Yes | Link to Content | |
| additionalInfo | No | Additional information (optional) | |
| contentType | Yes | Content type | |
| description | Yes | What was it about? | |
| metrics | Yes | ||
| private | No | Do you want to make this activity private? (optional) | |
| tags | No | Tags (optional) | |
| title | Yes | What was the title? |
Implementation Reference
- src/server.ts:80-142 (registration)Registration of the 'submit_content_creation' tool in the ListTools response, including detailed input schema for validation.{ name: "submit_content_creation", description: "Submit a content creation activity draft", inputSchema: { type: "object", properties: { title: { type: "string", description: "What was the title?", minLength: 3, maxLength: 200, }, description: { type: "string", description: "What was it about?", maxLength: 2000, }, activityDate: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "Date published (YYYY-MM-DD format)", }, contentType: { type: "string", description: "Content type", enum: Object.values(ContentType), }, tags: { type: "array", items: { type: "string" }, description: "Tags (optional)", minItems: 0, }, metrics: { type: "object", properties: { readers: { type: "integer", minimum: 1, description: "How many people read your content?", }, }, required: ["readers"], }, activityUrl: { type: "string", maxLength: 500, pattern: "^https?://.*", description: "Link to Content", }, additionalInfo: { type: "string", maxLength: 2000, description: "Additional information (optional)", }, private: { type: "boolean", description: "Do you want to make this activity private? (optional)", }, }, required: ["title", "description", "activityDate", "contentType", "metrics", "activityUrl"], }, },
- src/server.ts:80-142 (schema)Input schema definition for the submit_content_creation tool, specifying properties, types, constraints, and required fields.{ name: "submit_content_creation", description: "Submit a content creation activity draft", inputSchema: { type: "object", properties: { title: { type: "string", description: "What was the title?", minLength: 3, maxLength: 200, }, description: { type: "string", description: "What was it about?", maxLength: 2000, }, activityDate: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "Date published (YYYY-MM-DD format)", }, contentType: { type: "string", description: "Content type", enum: Object.values(ContentType), }, tags: { type: "array", items: { type: "string" }, description: "Tags (optional)", minItems: 0, }, metrics: { type: "object", properties: { readers: { type: "integer", minimum: 1, description: "How many people read your content?", }, }, required: ["readers"], }, activityUrl: { type: "string", maxLength: 500, pattern: "^https?://.*", description: "Link to Content", }, additionalInfo: { type: "string", maxLength: 2000, description: "Additional information (optional)", }, private: { type: "boolean", description: "Do you want to make this activity private? (optional)", }, }, required: ["title", "description", "activityDate", "contentType", "metrics", "activityUrl"], }, },
- src/server.ts:609-682 (handler)Core handler logic that performs the HTTP POST request to the Advocu GDE API to submit the content creation activity draft, handles errors, and returns formatted response content.private async submitActivityDraft( endpoint: string, data: | ContentCreationDraft | PublicSpeakingDraft | WorkshopDraft | MentoringDraft | ProductFeedbackDraft | GooglerInteractionDraft | StoryDraft, ): Promise<{ content: Array<{ type: string; text: string; }>; }> { const url = `${this.baseUrl}/activity-drafts/${endpoint}`; try { const response = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${this.accessToken}`, }, body: JSON.stringify(data), }); if (!response.ok) { const errorText = await response.text(); let errorMessage = `GDE API error (${response.status})`; if (response.status === 401) { errorMessage = "❌ GDE authentication failed. Your ADVOCU_ACCESS_TOKEN may be expired or invalid.\n\nPlease check your Advocu access token configuration."; } else if (response.status === 400) { errorMessage = `❌ GDE API rejected the request:\n\n${errorText}\n\nPlease check:\n- All required fields are present\n- Field values match expected formats\n- Tags are valid\n- Date format is correct (YYYY-MM-DD)`; } else if (response.status === 429) { errorMessage = "⏱️ GDE API rate limit exceeded (30 requests/minute). Please wait and try again."; } else { errorMessage = `❌ GDE API error (${response.status}):\n\n${errorText}`; } // Return error as content instead of throwing return { content: [ { type: "text", text: errorMessage, }, ], }; } const result = (await response.json()) as Record<string, unknown>; return { content: [ { type: "text", text: `✅ GDE Activity draft submitted successfully!\n\nEndpoint: ${endpoint}\nStatus: ${response.status}\nResponse: ${JSON.stringify(result, null, 2)}`, }, ], }; } catch (error) { if (error instanceof McpError) { throw error; } const errorMsg = this.getErrorMessage(error); throw new McpError( ErrorCode.InternalError, `❌ Failed to submit GDE activity:\n\n${errorMsg}\n\nEndpoint: ${endpoint}` ); } }
- src/server.ts:576-577 (handler)Dispatch case in the MCP tool call handler that routes 'submit_content_creation' invocations to the submitActivityDraft method with the specific 'content-creation' endpoint.case "submit_content_creation": return await this.submitActivityDraft("content-creation", args as unknown as ContentCreationDraft);