Skip to main content
Glama
pushkarsingh32

Semantic Pen MCP Server

get_article

Retrieve full article content by ID for editing, analysis, or integration within the Semantic Pen MCP Server's AI-powered content workflow.

Instructions

Get a specific article by ID with full content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
articleIdYesThe ID of the article to retrieve

Implementation Reference

  • The primary handler function that executes the 'get_article' tool logic. It makes an API request to fetch article details, processes the response (calculates word count, generates preview, formats status), and returns a structured MCP response with text content.
    private async getArticle(articleId: string) {
      const result = await this.makeRequest<ArticleDetail>(`/articles/${articleId}`);
      
      if (result.success && result.data) {
        const article = result.data;
        const title = article.extra_data?.targetArticleTopic || 'Untitled Article';
        const wordCount = article.output ? 
          Math.round(article.output.replace(/<[^>]*>/g, '').split(/\s+/).filter(word => word.length > 0).length) : 0;
        
        // Create a clean preview of the content (first 300 characters)
        const cleanContent = article.output ? 
          article.output
            .replace(/<[^>]*>/g, '') // Remove HTML tags
            .replace(/\n\s*\n/g, '\n') // Remove extra newlines
            .trim() 
          : 'Content not yet generated';
    
        const preview = cleanContent.length > 300 ? 
          cleanContent.substring(0, 300) + '...' : 
          cleanContent;
    
        const statusEmoji = article.status === 'finished' ? 'āœ…' : 
                           article.status === 'processing' ? 'šŸ”„' : 
                           article.status === 'failed' ? 'āŒ' : 'ā³';
    
        return {
          content: [
            {
              type: "text",
              text: `šŸ“„ **${title}**\n\n${statusEmoji} **Status:** ${article.status} (${article.progress}%)\n**Article ID:** ${article.id}\n**Project:** ${article.project_name}\n**Created:** ${new Date(article.created_at).toLocaleDateString()}\n**Word Count:** ~${wordCount} words\n\n**Settings:**\n- Target Keyword: ${article.config?.targetKeyword || 'N/A'}\n- Language: ${article.config?.language || 'English'}\n- Type: ${article.config?.articleType || 'Article'}\n- Tone: ${article.config?.toneOfVoice || 'Professional'}\n- Target Words: ${article.config?.wordCount || 'N/A'}\n\n**Content Preview:**\n${preview}\n\n---\nšŸ’” **Full HTML Content Available:** The complete article HTML is in the \`output\` field and can be used for publishing or further editing.`
            }
          ]
        };
      } else {
        return {
          content: [
            {
              type: "text",
              text: `āŒ Failed to fetch article: ${result.error}`
            }
          ],
          isError: true
        };
      }
    }
  • The input schema for the 'get_article' tool, specifying that 'articleId' (string) is required.
    inputSchema: {
      type: "object",
      properties: {
        articleId: {
          type: "string",
          description: "The ID of the article to retrieve"
        }
      },
      required: ["articleId"]
    }
  • src/index.ts:326-331 (registration)
    Registration and dispatch logic in the CallToolRequestHandler: validates input arguments and invokes the getArticle handler.
    case "get_article": {
      if (!args || typeof args !== 'object' || !('articleId' in args) || typeof args.articleId !== 'string') {
        throw new Error("articleId is required and must be a string");
      }
      return await this.getArticle(args.articleId);
    }
  • Full tool specification in ListToolsRequestHandler, including name, description, and input schema.
      name: "get_article",
      description: "Get a specific article by ID with full content",
      inputSchema: {
        type: "object",
        properties: {
          articleId: {
            type: "string",
            description: "The ID of the article to retrieve"
          }
        },
        required: ["articleId"]
      }
    }
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 the tool retrieves an article with full content, implying a read-only operation, but doesn't mention potential errors (e.g., invalid ID), permissions required, rate limits, or response format. This leaves significant gaps for a tool with no annotation coverage.

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, efficient sentence that front-loads the core action ('Get a specific article') and adds necessary detail ('by ID with full content') without any wasted words. It's appropriately sized for a simple retrieval tool.

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 tool's simplicity (1 parameter, 100% schema coverage) but lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like error handling or response structure, which are crucial for an agent to use it correctly, especially with no output schema to clarify return values.

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 description coverage is 100%, with the parameter 'articleId' fully documented in the schema. The description adds no additional meaning beyond implying retrieval by ID, so it meets the baseline of 3 where 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 verb ('Get') and resource ('article') with specificity ('by ID with full content'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'get_project_articles' or 'search_projects', which might also retrieve articles in different contexts.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_project_articles' or 'search_projects'. It lacks context about prerequisites, such as needing an article ID, or exclusions, leaving the agent to infer usage based on the name alone.

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