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);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only states what the tool does but reveals no additional behavior such as auth requirements, pagination, error handling, or result format. For a read operation, some transparency about these aspects would be expected.

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, direct sentence with no filler or redundant words. Every word contributes to the meaning, making it highly efficient and well-structured.

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

Completeness4/5

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

For a simple tool with one parameter and no output schema, the description is largely sufficient: it names the input and the expected result ('all articles'). However, the lack of behavioral and usage guidance slightly reduces completeness, preventing a perfect score.

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?

The schema already fully describes the single parameter 'projectId' with a clear description. The tool description adds minimal extra meaning beyond restating the parameter's role. Since schema coverage is 100%, the baseline is 3, and the description does not enhance parameter understanding beyond the schema.

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

Purpose5/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'), the resource ('articles'), and the scope ('from a specific project by project ID'). It distinguishes itself from sibling tools like 'get_projects' (which lists projects) and 'get_article' (which likely retrieves a single article).

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

Usage Guidelines3/5

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

The description implies usage when you have a project ID and need all its articles, but it does not explicitly contrast with sibling tools or state when not to use this tool. The context is sufficient for a simple case, but no alternatives or exclusions are mentioned.

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