Skip to main content
Glama
receptopalak

PostGIS MCP Server

by receptopalak

create-buffer

Generate a spatial buffer around a specified geometry in WKT format using a defined distance in meters. Enables precise spatial analysis with the PostGIS MCP Server.

Instructions

Geometri etrafında buffer oluştur

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
distance_metersYesBuffer mesafesi (metre)
geometry_wktYesWKT formatında geometri

Implementation Reference

  • Implements the create-buffer tool: parses input using CreateBufferSchema, queries PostGIS with ST_Buffer to create a buffer around the input geometry, returns buffer in WKT and GeoJSON formats along with area.
        case "create-buffer": {
            const { geometry_wkt, distance_meters } = CreateBufferSchema.parse(args);
            const result = yield client.query(`
      SELECT 
        ST_AsText(ST_Buffer(ST_GeomFromText($1), $2)) as buffer_wkt,
        ST_AsGeoJSON(ST_Buffer(ST_GeomFromText($1), $2)) as buffer_geojson,
        ST_Area(ST_Buffer(ST_GeomFromText($1), $2)) as buffer_area
    `, [geometry_wkt, distance_meters]);
            const response = {
                original_geometry: geometry_wkt,
                buffer_distance_meters: distance_meters,
                buffer_wkt: result.rows[0].buffer_wkt,
                buffer_geojson: JSON.parse(result.rows[0].buffer_geojson),
                buffer_area: parseFloat(result.rows[0].buffer_area),
            };
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(response, null, 2),
                    },
                ],
            };
        }
  • Zod schema defining the input parameters for create-buffer: geometry_wkt (string) and distance_meters (number). Used for validation in the handler.
    const CreateBufferSchema = zod_1.z.object({
        geometry_wkt: zod_1.z.string(),
        distance_meters: zod_1.z.number(),
    });
  • server.js:133-144 (registration)
    Registers the create-buffer tool in the ListTools response with name, description, and inputSchema matching the Zod schema.
    {
        name: "create-buffer",
        description: "Geometri etrafında buffer oluştur",
        inputSchema: {
            type: "object",
            properties: {
                geometry_wkt: { type: "string", description: "WKT formatında geometri" },
                distance_meters: { type: "number", description: "Buffer mesafesi (metre)" },
            },
            required: ["geometry_wkt", "distance_meters"],
        },
    },
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. It states the action ('create buffer') but doesn't disclose behavioral traits such as whether this is a read-only or mutating operation, what the output looks like (e.g., a new geometry object), error conditions, or performance considerations. For a tool with no annotations, 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.

Conciseness4/5

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

The description is a single, efficient sentence in Turkish ('Geometri etrafında buffer oluştur'), which is appropriately sized and front-loaded with the core action. It wastes no words, though it could benefit from slightly more detail to improve clarity without losing conciseness.

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 (geometric operation with 2 parameters), no annotations, and no output schema, the description is incomplete. It doesn't explain what a 'buffer' is, the output type (e.g., a polygon), or how it integrates with other tools. For a creation tool in a spatial context, more context is needed to guide 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?

Schema description coverage is 100%, with clear descriptions for both parameters ('distance_meters' and 'geometry_wkt'). The description adds no additional meaning beyond the schema, as it doesn't explain parameter interactions, units beyond meters, or WKT format specifics. Baseline score of 3 is appropriate since the schema adequately documents parameters.

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

Purpose3/5

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

The description 'Geometri etrafında buffer oluştur' (Create buffer around geometry) states a clear verb ('oluştur' - create) and resource ('buffer'), but it's vague about what a 'buffer' is in this context and doesn't differentiate from siblings like 'create-polygon' or 'geometry-convex-hull' that might create similar geometric outputs. The purpose is understandable but lacks specificity about the output type or geometric 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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't explain if this is for creating protective zones, proximity analysis, or how it differs from 'create-polygon' or other geometry-creation tools in the sibling list. The description implies usage for buffers around geometries but offers no context about appropriate scenarios 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/receptopalak/postgis-mcp'

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