get_projects
Retrieve all projects from your article queue to manage and optimize SEO-friendly content efficiently within the Semantic Pen MCP Server environment.
Instructions
Get all projects from your article queue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:351-393 (handler)The main handler function `getProjects()` that executes the tool logic: fetches projects from the '/article-queue' API, groups by project_id, counts articles, formats a markdown summary, and returns in MCP content format.private async getProjects() { const result = await this.makeRequest<ProjectQueueResponse>('/article-queue'); if (result.success && result.data) { const projects = result.data.data.projects; // Group by project name and get unique projects const uniqueProjects = projects.reduce((acc: { [key: string]: Project & { totalArticles: number } }, project) => { if (!acc[project.project_id]) { acc[project.project_id] = { ...project, totalArticles: 1 }; } else { acc[project.project_id].totalArticles += 1; } return acc; }, {}); const projectList = Object.values(uniqueProjects).map(project => `📁 **${project.project_name}** (${project.totalArticles} articles)\n Project ID: ${project.project_id}\n Latest Article: ${project.extra_data.targetArticleTopic}\n Created: ${new Date(project.created_at).toLocaleDateString()}\n Status: ${project.status}` ).join('\n\n'); return { content: [ { type: "text", text: `📋 **Your Projects** (${Object.keys(uniqueProjects).length} projects, ${result.data.count} total articles)\n\n${projectList || 'No projects found.'}` } ] }; } else { return { content: [ { type: "text", text: `❌ Failed to fetch projects: ${result.error}` } ], isError: true }; } }
- src/index.ts:195-202 (registration)Registration of the 'get_projects' tool in the ListTools response, specifying name, description, and input schema (no parameters required).{ name: "get_projects", description: "Get all projects from your article queue", inputSchema: { type: "object", properties: {} } },
- src/index.ts:292-293 (handler)Dispatcher case in the CallToolRequestSchema handler that routes 'get_projects' calls to the getProjects() implementation.case "get_projects": return await this.getProjects();
- src/index.ts:198-201 (schema)Input schema for the 'get_projects' tool, defining an empty object (no input parameters required).inputSchema: { type: "object", properties: {} }