Skip to main content
Glama

get_projects

Retrieve all projects from your article queue to manage and organize content creation workflows.

Instructions

Get all projects from your article queue

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get_projects' tool. Fetches projects from the SemanticPen API endpoint '/article-queue', groups duplicate entries by project_id, computes total article counts per project, formats a rich text response listing all projects, and handles errors.
    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 ListToolsRequest handler, specifying its name, description, and empty 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 (registration)
    Dispatch logic in the CallToolRequest handler that matches the tool name and invokes the getProjects handler method.
    case "get_projects": return await this.getProjects();
  • TypeScript interface defining the structure of a Project object returned from the API, used in the getProjects handler for type safety and processing.
    interface Project { id: string; created_at: string; status: string; statusDetails: string; progress: number; error: string | null; project_id: string; project_name: string; extra_data: { targetArticleTopic: string; }; article_count: number; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pushkarsingh32/semantic-pen-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server