uber_get_ride_status
Retrieve the current status of an Uber ride by providing the user ID and ride request ID, enabling real-time updates on ride progress.
Instructions
Get the current status of a ride request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | Ride request ID | |
| userId | Yes | Unique identifier for the user |
Implementation Reference
- src/index.ts:249-268 (handler)MCP tool handler for uber_get_ride_status: validates input with schema, retrieves user token, authenticates client, fetches ride status from UberClient, and returns JSON response.case 'uber_get_ride_status': { const { userId, requestId } = RideStatusSchema.parse(args); const token = userTokens.get(userId); if (!token) { throw new Error('User not authenticated. Please authorize first.'); } uberClient.setAccessToken(token); const status = await uberClient.getRideStatus(requestId); return { content: [ { type: 'text', text: JSON.stringify(status, null, 2), }, ], }; }
- src/index.ts:62-65 (schema)Zod input schema defining userId and requestId for the uber_get_ride_status tool.const RideStatusSchema = z.object({ userId: z.string().describe('Unique identifier for the user'), requestId: z.string().describe('Ride request ID'), });
- src/index.ts:128-132 (registration)Tool registration in the TOOLS array, including name, description, and input schema reference.{ name: 'uber_get_ride_status', description: 'Get the current status of a ride request', inputSchema: zodToJsonSchema(RideStatusSchema), },
- src/uber-client.ts:91-94 (helper)UberClient helper method that performs the API call to retrieve ride status from Uber's /v1.2/requests/{requestId} endpoint.async getRideStatus(requestId: string): Promise<RideRequest> { const response = await this.api.get(`/v1.2/requests/${requestId}`); return response.data; }