Skip to main content
Glama

Get Article

get_article

Retrieve a specific article by its unique ID within Emlog blog systems, including handling password-protected content.

Instructions

Get a specific article by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the article to retrieve
passwordNoPassword for protected articles

Implementation Reference

  • The handler function for the "get_article" MCP tool. It fetches the article details using emlogClient and returns formatted text output.
    async ({ id, password }) => {
      try {
        const article = await emlogClient.getArticleDetail(id, password);
        return {
          content: [{
            type: "text",
            text: `Article: ${article.title}\n\nContent: ${article.content}\n\nExcerpt: ${article.excerpt || 'N/A'}\nCategory: ${article.sort_id}\nTags: ${article.tags || 'N/A'}\nViews: ${article.views}\nComments: ${article.comnum}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `Error: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    }
  • Input schema for the get_article tool using Zod validation.
    inputSchema: {
      id: z.number().describe("The ID of the article to retrieve"),
      password: z.string().optional().describe("Password for protected articles")
    }
  • src/index.ts:280-281 (registration)
    Registration of the "get_article" tool with the MCP server.
    server.registerTool(
      "get_article",
  • Helper method in EmlogClient that performs the actual API call to retrieve article details.
    async getArticleDetail(id: number, password?: string): Promise<EmlogPost> {
      const params: { id: number; password?: string } = { id };
      if (password) params.password = password;
      const queryParams = this.buildParams(params);
      const response = await this.api.get(`/?rest-api=article_detail&${queryParams.toString()}`);
      return response.data.data.article;
    }
  • TypeScript interface defining the structure of an EmlogPost, used for typing the article data.
    export interface EmlogPost {
      id: number;
      title: string;
      content: string;
      content_raw?: string;
      excerpt?: string;
      excerpt_raw?: string;
      description?: string;
      description_raw?: string;
      cover?: string;
      url?: string;
      author_id: number;
      author_name: string;
      author_avatar?: string;
      sort_id: number;
      sort_name: string;
      views: number;
      comnum: number;
      like_count: number;
      date: string;
      tags: Array<{ name: string; url: string }>;
      top: 'y' | 'n';
      sortop: 'y' | 'n';
      need_pwd: 'y' | 'n';
      allow_remark?: 'y' | 'n';
      password?: string;
      link?: string;
      fields?: Record<string, any>;
      type?: string;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool retrieves an article but doesn't describe what happens if the ID is invalid, whether it returns full or partial content, if authentication is needed, or error handling. This leaves significant gaps in understanding the tool's behavior beyond basic retrieval.

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 extremely concise with a single sentence that directly states the tool's purpose. It's front-loaded with the core action and contains no unnecessary words or redundant information, making it highly efficient for quick understanding.

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 lack of annotations and output schema, the description is incomplete for a retrieval tool. It doesn't explain what is returned (e.g., article content, metadata), error conditions, or authentication needs. For a tool with 2 parameters and no structured behavioral hints, more context is needed to fully understand its operation.

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%, so the schema fully documents both parameters ('id' and 'password'). The description adds no additional meaning beyond what's in the schema, such as explaining ID formats or when the password is required. This meets the baseline score 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') and resource ('a specific article by ID'), making the purpose immediately understandable. It distinguishes from siblings like 'search_articles' by focusing on retrieval of a single item rather than searching multiple. However, it doesn't explicitly contrast with other read operations like 'get_draft_detail' or 'get_comments', which slightly limits differentiation.

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. It doesn't mention when to choose 'get_article' over 'search_articles' for finding articles, or when to use it versus 'get_draft_detail' for draft content. There are also no prerequisites or exclusions stated, such as requiring authentication or article visibility.

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

Related 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/eraincc/emlog-mcp'

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