Skip to main content
Glama
cablate

MCP Google Map Server

maps_geocode

Convert addresses or landmark names into precise geographic coordinates using the MCP Google Map Server, enabling accurate location-based applications and services.

Instructions

將地址轉換為座標

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes要轉換的地址或地標名稱

Implementation Reference

  • Main handler function (ACTION) for the maps_geocode tool. It creates a PlacesSearcher instance, calls geocode on the provided address, and returns the result as MCP content or error.
    async function ACTION(params: any): Promise<{ content: any[]; isError?: boolean }> {
      try {
        // Create a new PlacesSearcher instance with the current request's API key
        const apiKey = getCurrentApiKey();
        const placesSearcher = new PlacesSearcher(apiKey);
        const result = await placesSearcher.geocode(params.address);
    
        if (!result.success) {
          return {
            content: [{ type: "text", text: result.error || "Failed to geocode address" }],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result.data, null, 2),
            },
          ],
          isError: false,
        };
      } catch (error: any) {
        const errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
        return {
          isError: true,
          content: [{ type: "text", text: `Error geocoding address: ${errorMessage}` }],
        };
      }
    }
  • Zod schema definition for input parameters (address) and TypeScript type inference for GeocodeParams.
    const SCHEMA = {
      address: z.string().describe("Address or place name to convert to coordinates"),
    };
    
    export type GeocodeParams = z.infer<z.ZodObject<typeof SCHEMA>>;
  • src/config.ts:35-40 (registration)
    Tool registration in server configuration, referencing the Geocode module's NAME, DESCRIPTION, SCHEMA, and ACTION.
    {
      name: Geocode.NAME,
      description: Geocode.DESCRIPTION,
      schema: Geocode.SCHEMA,
      action: (params: GeocodeParams) => Geocode.ACTION(params),
    },
  • src/config.ts:6-6 (registration)
    Import of the Geocode tool module and its params type.
    import { Geocode, GeocodeParams } from "./tools/maps/geocode.js";
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 only states the basic function without mentioning any behavioral traits such as rate limits, accuracy considerations, error handling, authentication needs, or output format. For a geocoding tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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 extremely concise and front-loaded, consisting of a single sentence that directly states the tool's purpose. There is no wasted language or unnecessary elaboration, making it efficient and easy to understand at a glance.

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 lack of annotations and output schema, the description is incomplete for a geocoding tool. It doesn't explain what the coordinates output looks like (e.g., latitude/longitude format), potential limitations, or how it integrates with sibling tools. The minimal description fails to provide sufficient context for effective use.

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?

The schema description coverage is 100%, with the single parameter 'address' fully documented in the schema as '要轉換的地址或地標名稱' (address or landmark name to convert). The description adds no additional semantic information beyond what the schema provides, such as examples or formatting tips. With high schema coverage, the baseline score of 3 is appropriate.

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 tool's purpose: converting addresses to coordinates. It specifies the verb '轉換為' (convert to) and the resource '地址' (address), making the function unambiguous. However, it doesn't explicitly differentiate from its sibling 'maps_reverse_geocode', which performs the inverse operation.

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 guidance on when to use this tool versus alternatives. It doesn't mention the sibling tools like 'maps_reverse_geocode' for the opposite conversion, 'search_nearby' for location-based searches, or other mapping tools. There's no context about appropriate use cases or exclusions.

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

Related 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/cablate/mcp-google-map'

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