Skip to main content
Glama
read.ts1.06 kB
import { readDraft } from '../../services/gmail/drafts.js'; import { ReadDraftArgs } from '../../services/gmail/types.js'; import { DEFAULTS } from '../../config/constants.js'; export const READ_DRAFT_TOOL = { name: "readDraft", description: "Get detailed information about a Gmail draft message", inputSchema: { type: "object", properties: { draftId: { type: "string", description: "ID of the draft to read" } }, required: ["draftId"] } }; export async function handleReadDraft(args: Record<string, unknown>) { try { // Explicit type and presence checking if (!args.draftId || typeof args.draftId !== 'string') { throw new Error('Invalid or missing draft ID'); } const typedArgs: ReadDraftArgs = { draftId: args.draftId }; return await readDraft(typedArgs); } catch (error) { return { content: [{ type: "text", text: `Error reading draft: ${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/zacco16/gmail-mcp-server'

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