Skip to main content
Glama
pushkarsingh32

Semantic Pen MCP Server

get_project_articles

Retrieve all articles from a specific project using its project ID to manage and access content within the Semantic Pen MCP Server.

Instructions

Get all articles from a specific project by project ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe project ID to get articles from

Implementation Reference

  • The primary handler function `getProjectArticles` that executes the tool logic: fetches articles for the given project ID via API, processes them (e.g., word count estimation), and returns a formatted list.
    private async getProjectArticles(projectId: string) {
      const result = await this.makeRequest<ProjectArticlesResponse>(`/article-queue/${projectId}`);
      
      if (result.success && result.data) {
        const articles = result.data.data.articles;
    
        if (articles.length === 0) {
          return {
            content: [
              {
                type: "text",
                text: `No articles found in project ${projectId}`
              }
            ]
          };
        }
    
        const articleList = articles.map(article => {
          const wordCount = article.html ? 
            Math.round(article.html.replace(/<[^>]*>/g, '').split(/\s+/).filter(word => word.length > 0).length) : 0;
          
          return `📄 **${article.title}**\n   ID: ${article.id}\n   Word Count: ~${wordCount} words\n   Created: ${new Date(article.created_at).toLocaleDateString()}\n   Keyword: ${article.setting?.targetKeyword || 'N/A'}`;
        }).join('\n\n');
    
        return {
          content: [
            {
              type: "text",
              text: `📚 **Project Articles** (${result.data.count} articles)\n**Project ID:** ${projectId}\n\n${articleList}`
            }
          ]
        };
      } else {
        return {
          content: [
            {
              type: "text",
              text: `❌ Failed to fetch project articles: ${result.error}`
            }
          ],
          isError: true
        };
      }
    }
  • src/index.ts:203-216 (registration)
    Tool registration in the list of tools provided by ListToolsRequestHandler, including name, description, and input schema.
    {
      name: "get_project_articles",
      description: "Get all articles from a specific project by project ID",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "string",
            description: "The project ID to get articles from"
          }
        },
        required: ["projectId"]
      }
    },
  • Input schema definition for the tool, specifying that 'projectId' is a required string.
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "string",
            description: "The project ID to get articles from"
          }
        },
        required: ["projectId"]
      }
    },
  • Dispatch handler in the CallToolRequestHandler switch statement that validates input and delegates to the main getProjectArticles function.
    case "get_project_articles": {
      if (!args || typeof args !== 'object' || !('projectId' in args) || typeof args.projectId !== 'string') {
        throw new Error("projectId is required and must be a string");
      }
      return await this.getProjectArticles(args.projectId);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states a read operation ('Get') but doesn't cover critical aspects like pagination, rate limits, authentication needs, error handling, or what 'all articles' entails (e.g., filtering, sorting). This leaves significant gaps for a tool that likely returns multiple items.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that front-loads the core action and resource without any wasted words. It efficiently communicates the essential purpose, making it easy for an agent to parse quickly and accurately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a list-fetching tool with no annotations and no output schema, the description is incomplete. It lacks details on return format (e.g., array structure, fields), behavioral traits (e.g., pagination, limits), and error cases, which are crucial for an agent to use this tool effectively in real scenarios.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'projectId' well-documented in the schema. The description adds no additional meaning beyond implying it's used to fetch articles, matching the schema's purpose. This meets the baseline of 3 since the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get all articles') and resource ('from a specific project by project ID'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_article' (singular vs. plural) or 'search_projects' (articles vs. projects), missing explicit distinction that would warrant a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get_article' (for a single article) or 'search_projects' (for project-level queries). The description implies usage by mentioning 'project ID' but lacks explicit context, prerequisites, or exclusions, leaving the agent to infer usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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