create_delivery_quote
Generate delivery cost estimates for DoorDash orders using pickup and dropoff addresses, business details, and order value to plan logistics.
Instructions
Get a quote for a delivery request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| external_delivery_id | Yes | Unique identifier for the delivery | |
| pickup_address | Yes | Pickup address | |
| pickup_business_name | No | Business name for pickup | |
| pickup_phone_number | No | Phone number for pickup | |
| pickup_instructions | No | Special instructions for pickup | |
| dropoff_address | Yes | Dropoff address | |
| dropoff_business_name | No | Business name for dropoff | |
| dropoff_phone_number | No | Phone number for dropoff | |
| dropoff_instructions | No | Special instructions for dropoff | |
| order_value | No | Value of the order in cents |
Implementation Reference
- index.js:66-66 (handler)The handler function that executes the core logic of the 'create_delivery_quote' tool by calling DoorDashClient.deliveryQuote with the provided arguments.handler: (client, args) => client.deliveryQuote(args),
- index.js:50-65 (schema)Input schema defining the parameters and validation for the 'create_delivery_quote' tool.inputSchema: { type: 'object', properties: { external_delivery_id: { type: 'string', description: 'Unique identifier for the delivery' }, pickup_address: { type: 'string', description: 'Pickup address' }, pickup_business_name: { type: 'string', description: 'Business name for pickup' }, pickup_phone_number: { type: 'string', description: 'Phone number for pickup' }, pickup_instructions: { type: 'string', description: 'Special instructions for pickup' }, dropoff_address: { type: 'string', description: 'Dropoff address' }, dropoff_business_name: { type: 'string', description: 'Business name for dropoff' }, dropoff_phone_number: { type: 'string', description: 'Phone number for dropoff' }, dropoff_instructions: { type: 'string', description: 'Special instructions for dropoff' }, order_value: { type: 'number', description: 'Value of the order in cents' }, }, required: ['external_delivery_id', 'pickup_address', 'dropoff_address'], },
- index.js:47-67 (registration)Registration of the 'create_delivery_quote' tool within the TOOLS array used by the MCP server.{ name: 'create_delivery_quote', description: 'Get a quote for a delivery request', inputSchema: { type: 'object', properties: { external_delivery_id: { type: 'string', description: 'Unique identifier for the delivery' }, pickup_address: { type: 'string', description: 'Pickup address' }, pickup_business_name: { type: 'string', description: 'Business name for pickup' }, pickup_phone_number: { type: 'string', description: 'Phone number for pickup' }, pickup_instructions: { type: 'string', description: 'Special instructions for pickup' }, dropoff_address: { type: 'string', description: 'Dropoff address' }, dropoff_business_name: { type: 'string', description: 'Business name for dropoff' }, dropoff_phone_number: { type: 'string', description: 'Phone number for dropoff' }, dropoff_instructions: { type: 'string', description: 'Special instructions for dropoff' }, order_value: { type: 'number', description: 'Value of the order in cents' }, }, required: ['external_delivery_id', 'pickup_address', 'dropoff_address'], }, handler: (client, args) => client.deliveryQuote(args), },
- index.js:164-191 (registration)MCP server request handler for calling tools, which dispatches to the specific tool handler based on the tool name.server.setRequestHandler(CallToolRequestSchema, async (request) => { if (!ddClient) { ddClient = initializeDoorDashClient(); if (!ddClient) { throw new Error('DoorDash client not initialized. Please set environment variables.'); } } const { name, arguments: args } = request.params; const tool = TOOLS.find((t) => t.name === name); if (!tool) { throw new Error(`Unknown tool: ${name}`); } try { const response = await tool.handler(ddClient, args); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { throw new Error(`DoorDash API error: ${error.message}`); } });
- index.js:29-44 (helper)Helper function to initialize the DoorDashClient instance used by all tool handlers, including create_delivery_quote.function initializeDoorDashClient() { const developerId = process.env.DOORDASH_DEVELOPER_ID; const keyId = process.env.DOORDASH_KEY_ID; const signingSecret = process.env.DOORDASH_SIGNING_SECRET; if (!developerId || !keyId || !signingSecret) { console.error('Missing required DoorDash environment variables: DOORDASH_DEVELOPER_ID, DOORDASH_KEY_ID, DOORDASH_SIGNING_SECRET'); return null; } return new DoorDashClient({ developer_id: developerId, key_id: keyId, signing_secret: signingSecret, }); }