Skip to main content
Glama

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

NameRequiredDescriptionDefault
countNoNumber of drafts to retrieve

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "count": { "description": "Number of drafts to retrieve", "type": "number" } }, "type": "object" }

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

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