Skip to main content
Glama

uber_cancel_ride

Cancel an ongoing Uber ride request by providing user and request IDs to manage ride bookings.

Instructions

Cancel an ongoing ride request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUnique identifier for the user
requestIdYesRide request ID to cancel

Implementation Reference

  • Handler for the uber_cancel_ride tool: parses arguments using CancelRideSchema, retrieves and sets user access token, calls uberClient.cancelRide(requestId), and returns a success message.
    case 'uber_cancel_ride': { const { userId, requestId } = CancelRideSchema.parse(args); const token = userTokens.get(userId); if (!token) { throw new Error('User not authenticated. Please authorize first.'); } uberClient.setAccessToken(token); await uberClient.cancelRide(requestId); return { content: [ { type: 'text', text: 'Ride cancelled successfully', }, ], }; }
  • Zod input schema definition for the uber_cancel_ride tool, specifying userId and requestId parameters.
    const CancelRideSchema = z.object({ userId: z.string().describe('Unique identifier for the user'), requestId: z.string().describe('Ride request ID to cancel'), });
  • src/index.ts:133-137 (registration)
    Registration of the uber_cancel_ride tool in the TOOLS array, including name, description, and input schema.
    { name: 'uber_cancel_ride', description: 'Cancel an ongoing ride request', inputSchema: zodToJsonSchema(CancelRideSchema), },
  • Core helper method in UberClient that performs the HTTP DELETE request to the Uber API to cancel a ride by requestId.
    async cancelRide(requestId: string): Promise<void> { await this.api.delete(`/v1.2/requests/${requestId}`); }

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/199-mcp/mcp-uber'

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