get-drafts
Retrieve all saved message drafts from Zulip workspaces to review, edit, or send unfinished messages.
Instructions
Retrieve all saved message drafts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:712-734 (registration)MCP tool registration for 'get-drafts' including the inline handler that fetches drafts using ZulipClient.getDrafts() and returns formatted MCP responseserver.tool( "get-drafts", "Retrieve all saved message drafts.", {}, async () => { try { const result = await zulipClient.getDrafts(); return createSuccessResponse(JSON.stringify({ draft_count: result.drafts.length, drafts: result.drafts.map(draft => ({ id: draft.id, type: draft.type, to: draft.to, topic: draft.topic, content: draft.content, timestamp: new Date(draft.timestamp * 1000).toISOString() })) }, null, 2)); } catch (error) { return createErrorResponse(`Error getting drafts: ${error instanceof Error ? error.message : 'Unknown error'}`); } } );
- src/zulip/client.ts:316-319 (handler)Core handler in ZulipClient that performs the actual API call to retrieve drafts from Zulip server (/drafts endpoint)async getDrafts(): Promise<{ drafts: ZulipDraft[] }> { const response = await this.client.get('/drafts'); return response.data; }