Skip to main content
Glama
199-mcp
by 199-mcp

uber_get_price_estimates

Calculate ride costs between two locations to help users plan and budget their Uber trips before booking.

Instructions

Get price estimates for a ride between two locations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYesUnique identifier for the user
startLatitudeYesStarting location latitude
startLongitudeYesStarting location longitude
endLatitudeYesDestination latitude
endLongitudeYesDestination longitude

Implementation Reference

  • MCP tool handler for 'uber_get_price_estimates': parses input, checks authentication, calls UberClient.getPriceEstimates, and returns JSON-formatted estimates.
    case 'uber_get_price_estimates': {
      const { userId, startLatitude, startLongitude, endLatitude, endLongitude } =
        PriceEstimateSchema.parse(args);
      
      const token = userTokens.get(userId);
      if (!token) {
        throw new Error('User not authenticated. Please authorize first.');
      }
      
      uberClient.setAccessToken(token);
      const estimates = await uberClient.getPriceEstimates(
        startLatitude,
        startLongitude,
        endLatitude,
        endLongitude
      );
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(estimates, null, 2),
          },
        ],
      };
    }
  • Core UberClient method that performs the API request to retrieve price estimates from Uber's /v1.2/estimates/price endpoint.
    async getPriceEstimates(
      startLat: number,
      startLng: number,
      endLat: number,
      endLng: number
    ): Promise<PriceEstimate[]> {
      const response = await this.api.get('/v1.2/estimates/price', {
        params: {
          start_latitude: startLat,
          start_longitude: startLng,
          end_latitude: endLat,
          end_longitude: endLng,
        },
      });
      return response.data.prices;
    }
  • Zod input schema for validating parameters of uber_get_price_estimates tool.
    const PriceEstimateSchema = z.object({
      userId: z.string().describe('Unique identifier for the user'),
      startLatitude: z.number().describe('Starting location latitude'),
      startLongitude: z.number().describe('Starting location longitude'),
      endLatitude: z.number().describe('Destination latitude'),
      endLongitude: z.number().describe('Destination longitude'),
    });
  • src/index.ts:118-122 (registration)
    Tool registration in the TOOLS array, including name, description, and input schema.
    {
      name: 'uber_get_price_estimates',
      description: 'Get price estimates for a ride between two locations',
      inputSchema: zodToJsonSchema(PriceEstimateSchema),
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool's function but doesn't reveal critical traits such as whether it's a read-only operation, if it requires authentication, potential rate limits, or what the output looks like (e.g., estimated price range, ride options). This leaves significant gaps for an agent to understand how to interact with it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the key action and resource without any wasted words. It's appropriately sized for a straightforward tool, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 required parameters, no annotations, no output schema), the description is insufficiently complete. It doesn't address behavioral aspects like authentication needs, output format, or error handling, which are crucial for an agent to use the tool correctly in real-world scenarios. The high parameter count and lack of structured support amplify this gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all parameters clearly documented in the input schema (e.g., 'userId', latitude/longitude pairs). The description adds minimal value beyond this, only implying that parameters define start and end locations without providing additional context like coordinate formats or user ID requirements. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get price estimates') and resource ('for a ride between two locations'), making the purpose immediately understandable. However, it doesn't differentiate this from potential sibling tools like 'uber_request_ride' which might also involve pricing, though the distinction is somewhat implied through the 'estimates' keyword.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus alternatives like 'uber_request_ride' or 'uber_get_ride_status'. It mentions the core function but lacks context about prerequisites (e.g., whether authentication is needed) or typical use cases (e.g., planning vs. booking).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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