Skip to content
← Public packages

@kody/doordash

Order food on DoorDash as a customer through the consumer MCP used by dd-cli.

src/menu.ts

24 lines · 723 B · TypeScript
/**
 * Restaurant menu (`doordash_get_restaurant_menu`).
 *
 * ```ts
 * import menu from 'kody:@kody/doordash/menu'
 * await menu({ storeId: '928163' })
 * ```
 */

import { callMcpTool, TOOLS, type DoorDashMcpAuthInput } from './mcp.ts'

export type MenuInput = DoorDashMcpAuthInput & {
	storeId: string | number
	addressId?: string
	dryRun?: boolean
}

export default async function menu(input: MenuInput) {
	const storeId = String(input.storeId ?? '').trim()
	if (!storeId) throw new Error('storeId is required.')
	const args: Record<string, unknown> = { store_id: storeId }
	if (input.addressId) args.address_id = String(input.addressId)
	return callMcpTool({ ...input, name: TOOLS.restaurantMenu, arguments: args })
}