Skip to main content
Glama
receptopalak

PostGIS MCP Server

by receptopalak

raster-info

Retrieve detailed information about raster data stored in a PostGIS table, including metadata and spatial attributes, for efficient data analysis and management.

Instructions

Raster verisinin bilgilerini al

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
raster_columnNoRaster kolonu (varsayılan: rast)
table_nameYesRaster tablosu adı

Implementation Reference

  • Handler implementation for 'raster-info' tool. Parses input schema, sanitizes parameters, queries PostGIS for raster metadata (num_bands, width, height, pixel sizes, SRID, envelope, tile_count), and returns JSON response.
    case "raster-info": {
      const { table_name, raster_column } = RasterInfoSchema.parse(args);
    
      const sanitizedTableName = table_name.replace(/[^a-zA-Z0-9_]/g, "");
      const sanitizedRasterColumn = raster_column || "rast";
    
      const result = await client.query(`
        SELECT 
          ST_NumBands(${sanitizedRasterColumn}) as num_bands,
          ST_Width(${sanitizedRasterColumn}) as width,
          ST_Height(${sanitizedRasterColumn}) as height,
          ST_PixelWidth(${sanitizedRasterColumn}) as pixel_width,
          ST_PixelHeight(${sanitizedRasterColumn}) as pixel_height,
          ST_SRID(${sanitizedRasterColumn}) as srid,
          ST_AsText(ST_Envelope(${sanitizedRasterColumn})) as envelope_wkt,
          COUNT(*) as tile_count
        FROM ${sanitizedTableName}
        GROUP BY 
          ST_NumBands(${sanitizedRasterColumn}),
          ST_Width(${sanitizedRasterColumn}),
          ST_Height(${sanitizedRasterColumn}),
          ST_PixelWidth(${sanitizedRasterColumn}),
          ST_PixelHeight(${sanitizedRasterColumn}),
          ST_SRID(${sanitizedRasterColumn}),
          ST_AsText(ST_Envelope(${sanitizedRasterColumn}))
        LIMIT 1;
      `);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                table_name: sanitizedTableName,
                raster_column: sanitizedRasterColumn,
                raster_info: result.rows[0] || null,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • Input schema validation using Zod for 'raster-info' tool: requires table_name, optional raster_column defaulting to 'rast'.
    const RasterInfoSchema = z.object({
      table_name: z.string(),
      raster_column: z.string().optional().default("rast"),
    });
  • server.ts:921-934 (registration)
    Registration of 'raster-info' tool in the ListTools handler, providing name, description, and input schema.
      name: "raster-info",
      description: "Raster verisinin bilgilerini al",
      inputSchema: {
        type: "object",
        properties: {
          table_name: { type: "string", description: "Raster tablosu adı" },
          raster_column: {
            type: "string",
            description: "Raster kolonu (varsayılan: rast)",
          },
        },
        required: ["table_name"],
      },
    },
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 action ('get information') without describing what the output includes (e.g., metadata, statistics, format), whether it's a read-only operation, or any limitations (e.g., performance, data size). This leaves significant gaps for a tool with no annotation coverage.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool, though it could be slightly more informative 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'information' is returned (e.g., raster dimensions, metadata, statistics), which is critical for understanding the tool's utility. For a data retrieval tool with no structured output documentation, this is a significant 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?

The schema description coverage is 100%, with clear descriptions for both parameters ('raster_column' and 'table_name'). The description adds no additional meaning beyond what the schema provides, such as explaining the relationship between these parameters or usage examples. 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.

Purpose3/5

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

The description 'Raster verisinin bilgilerini al' (Get raster data information) states a clear verb ('get') and resource ('raster data information'), but it's vague about what specific information is retrieved. It doesn't differentiate from sibling tools like 'geometry-info' or 'get-table-info', which also retrieve information about different data types.

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 prerequisites, context for raster data analysis, or how it differs from other info-retrieval tools in the sibling list (e.g., 'geometry-info' for geometry data).

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