Skip to main content
Glama

Get Draft List

get_draft_list

Retrieve a list of draft articles from the Emlog blog system using specified count, enabling efficient draft management and content planning.

Instructions

Get list of draft articles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of drafts to retrieve

Implementation Reference

  • src/index.ts:573-605 (registration)
    MCP tool registration for 'get_draft_list', including schema definition and handler function.
    server.registerTool(
      "get_draft_list",
      {
        title: "Get Draft List",
        description: "Get list of draft articles",
        inputSchema: {
          count: z.number().optional().describe("Number of drafts to retrieve")
        }
      },
      async ({ count }) => {
        try {
          const result = await emlogClient.getDraftList({ count });
          const drafts = result.drafts;
          const draftList = drafts.map((draft: any) => 
            `- ID: ${draft.id}, Title: ${draft.title || 'Untitled'}, Date: ${draft.date}`
          ).join('\n');
          return {
            content: [{
              type: "text",
              text: `Draft articles (${drafts.length} found):\n\n${draftList || 'No drafts found'}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: "text",
              text: `Error: ${error instanceof Error ? error.message : String(error)}`
            }],
            isError: true
          };
        }
      }
    );
  • Core handler function in EmlogClient that executes the API request to retrieve the list of draft posts.
    async getDraftList(params: {
      count?: number;
    } = {}): Promise<{ drafts: EmlogPost[] }> {
      const queryParams = this.buildParams(params);
      const response = await this.api.get(`/?rest-api=draft_list&${queryParams.toString()}`);
      return response.data.data;
    }
  • Input schema definition using Zod for the get_draft_list tool, specifying optional 'count' parameter.
    {
      title: "Get Draft List",
      description: "Get list of draft articles",
      inputSchema: {
        count: z.number().optional().describe("Number of drafts to retrieve")
      }
    },
  • MCP tool execution handler that wraps the client call, processes the drafts list, and returns formatted text response.
    async ({ count }) => {
      try {
        const result = await emlogClient.getDraftList({ count });
        const drafts = result.drafts;
        const draftList = drafts.map((draft: any) => 
          `- ID: ${draft.id}, Title: ${draft.title || 'Untitled'}, Date: ${draft.date}`
        ).join('\n');
        return {
          content: [{
            type: "text",
            text: `Draft articles (${drafts.length} found):\n\n${draftList || 'No drafts found'}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: `Error: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose permissions, rate limits, pagination, sorting, or return format (e.g., list structure). This is inadequate for a tool with potential complexity in list 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 a single, efficient sentence with zero waste. It is front-loaded and appropriately sized for a simple tool, earning full marks for conciseness.

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 no annotations and no output schema, the description is incomplete. It lacks details on behavior, return values, and usage context, which are essential for an agent to effectively use this tool in a system with multiple article-related siblings.

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 the 'count' parameter. The description adds no parameter semantics beyond what the schema provides, meeting the baseline of 3 for high coverage without extra value.

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 the resource 'list of draft articles', making the purpose understandable. It distinguishes from siblings like 'get_draft_detail' (specific draft) and 'get_article' (published articles), but could be more specific about scope (e.g., all drafts vs filtered).

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 'search_articles' (which might filter drafts) or 'get_draft_detail' (for a single draft). The description implies usage for retrieving drafts but lacks explicit context or exclusions.

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