Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Generate graph projection

generate_graph_projection
Read-only

Generate openCypher statements to project relational tables into an Apache AGE property graph, turning rows into vertices and foreign keys into edges. Outputs Cypher for review, never executes.

Instructions

Generate openCypher CREATE/MERGE statements that project a relational schema into an Apache AGE property graph — rows become vertices (one label per table), foreign keys become edges. EMITS the Cypher for review; NEVER executes it (like generate_test_data). With row_limit=0 (default) it returns a schema-level template plan (one CREATE per label, one MERGE per edge type, $prop placeholders) reading only the catalog. With row_limit>0 it also emits concrete per-row statements (values escaped, NULLs omitted, capped at 1000 rows/table). Tables without a primary key still get node CREATEs but their edges are skipped (they can't be reliably MATCHed). NOTE: AGE materialises the data (this is a LOAD, not a virtual view); run the node statements before the edge statements; the projection is 1-hop faithful to the FK graph. Returns an object with available (AGE installed, advisory), schema, graph_name, row_limit, node_labels (list of label, source_table, key_columns, property_columns), edge_types (list of edge_type, from_label, to_label, from_key, to_key, fk_name), cypher_statements (generated, never executed), warnings, and detail.

Example: generate_graph_projection(schema='public', graph_name='g', row_limit=0)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaYes
tablesNo
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.
row_limitNo
graph_nameNog

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailYes
schemaYes
warningsYes
availableYes
row_limitYes
edge_typesYes
graph_nameYes
node_labelsYes
cypher_statementsYes
Behavior5/5

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

Description does not contradict annotations (readOnlyHint: true, openWorldHint: false). It clarifies the tool only generates and never executes Cypher (consistent with read-only), and explains the two modes (schema-level vs. concrete statements) and side-effect of reading data but not modifying.

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?

Description is well-structured and front-loaded with purpose, but slightly lengthy. However, every sentence adds value, covering behavior, notes, and return object fields. No redundancy.

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

Completeness5/5

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

Given the tool's complexity (generating graph projections), the description is complete. It covers both modes, edge cases (no PK), execution order, materialization warning, and lists all return object fields. Output schema exists but description still adds context.

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

Parameters5/5

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

The description explains all parameters: schema, tables (optional), database (optional secondary), row_limit (0 for template, >0 for concrete rows), graph_name. It adds meaning beyond the schema (e.g., default values, effect of row_limit). Schema coverage is low but description compensates fully.

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

Purpose5/5

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

The description clearly states the tool generates openCypher statements to project a relational schema into an Apache AGE property graph, with specific verb 'generate', resource 'graph projection', and distinguishes from siblings by noting it never executes (like generate_test_data).

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

Usage Guidelines5/5

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

Explicit guidance on when to use (e.g., to project schemas, with row_limit behavior), and when not (tables without PK), plus notes on execution order and materialization. Also mentions alternatives implicitly by referencing generate_test_data behavior.

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/devopam/MCPg'

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