Skip to content
← Public packages

@kody/doordash

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

src/find-nearby-stores.ts

20 lines · 772 B · TypeScript
import { callMcpTool, TOOLS, type DoorDashMcpAuthInput } from './mcp.ts'

export type FindNearbyStoresInput = DoorDashMcpAuthInput & {
	vertical?: 'grocery' | 'alcohol' | 'convenience' | 'pets' | 'retail' | 'nv' | string
	lat?: number
	lng?: number
	addressId?: string
	max?: number
	dryRun?: boolean
}

export default async function findNearbyStores(input: FindNearbyStoresInput = {}) {
	const args: Record<string, unknown> = {}
	if (input.vertical) args.vertical = String(input.vertical)
	if (input.addressId) args.address_id = String(input.addressId)
	if (input.lat != null) args.lat = input.lat
	if (input.lng != null) args.lng = input.lng
	if (input.max != null) args.max = input.max
	return callMcpTool({ ...input, name: TOOLS.findNearbyStores, arguments: args })
}