Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
KNOWLEDGE_GRAPH_DIRYesThe directory path where knowledge graph data will be stored

Tools

Functions exposed to the LLM to take actions

NameDescription
create_graph

Create a new knowledge graph. Supports multiple graph types such as topology, timeline, changelog, requirement documentation, etc. Design guidelines for each graph type:

  • topology: Used to represent dependencies between system components and modules. Recommended to first create main module nodes, then add component nodes, and finally represent relationships through edges like calls, dependencies, and containment

  • timeline: Used to record important project events and decisions. Recommended to add event nodes in chronological order and link related personnel and decisions

  • changelog: Used to track change history of features and components. Recommended to create nodes for each significant change, marking change types and impact scope

  • requirement: Used for requirement management and tracking. Recommended to first create high-level requirements, then break down into specific features, and finally link to responsible persons and iterations

  • knowledge_base: Used to build domain knowledge systems. Recommended to start from core concepts and gradually expand related concepts and relationships

  • ontology: Used for formal representation of domain concepts and relationships, suitable for building standardized knowledge models

add_node

Add a node to the knowledge graph. Nodes are the basic units of the graph, and different types of graphs support different types of nodes. Use cases:

  1. Create component or module nodes in topology graphs

  2. Add event or decision nodes in timeline graphs

  3. Create requirement or feature nodes in requirement documents

  4. Build concept hierarchies in knowledge bases

Usage recommendations:

  1. First create the graph using create_graph

  2. Select the appropriate node type based on graph type

  3. Provide meaningful names and descriptions

  4. Link related files when applicable

  5. Add metadata for additional structured information

Return data:

  • data: Created node information

    • id: Node ID

    • type: Node type

    • name: Node name

    • description: Node description

    • createdAt: Creation time

add_edge

Add edges in the knowledge graph, connecting two nodes to build a relationship network. Edges represent relationship types between nodes, such as dependencies, containment, associations, etc. Prerequisites:

  1. Must first create a graph (using create_graph)

  2. Source and target nodes must already exist

  3. Edge type must match the graph type

Usage recommendations:

  1. First use list_graphs to get graph and node information

  2. Confirm both source and target nodes exist and their types match

  3. Choose appropriate edge type based on graph type

  4. Add meaningful labels to edges to help understand relationships

  5. If relationships have varying strengths, use the weight parameter

Return data:

  • data: Newly created edge information

    • id: Edge ID

    • type: Edge type

    • sourceId: Source node ID

    • targetId: Target node ID

    • label: Edge label

    • weight: Edge weight

publish_graph

Publish a knowledge graph, changing its status from draft to published. Published graphs can still be modified, but it's recommended to track important changes through version management. Prerequisites:

  1. Graph must exist and be in draft status

  2. Recommended to ensure graph content is complete before publishing

  3. Ensure all necessary nodes and edges have been added

Usage recommendations:

  1. First use list_graphs to check the current status of the graph

  2. Use get_node_details to check the completeness of key nodes

  3. Review the graph structure before publishing

  4. Record publication time for version management

  5. Notify relevant team members after publication

Return data:

  • data: Published graph information

    • id: Graph ID

    • name: Graph name

    • type: Graph type

    • status: Published

    • publishedAt: Publication time

list_graphs

List all knowledge graphs with support for filtering by status and type. This is the main tool for getting information about existing graphs and an important path for obtaining node IDs. Use cases:

  1. View all available graphs and their basic information

  2. Get the node list of a specific graph for subsequent edge addition or node detail queries

  3. Filter graphs by status, such as viewing all drafts or published graphs

  4. Filter graphs by type, such as viewing only topology or timeline graphs

Usage recommendations:

  1. First call this tool to get the graph list and node information

  2. Get the required graph ID and node ID from the returned data

  3. Use these IDs to call other tools (like add_edge, get_node_details)

  4. Recommended to use this tool to confirm the target graph's status before performing any node or edge operations

Return data:

  • data: List of graphs, each graph contains:

    • id: Graph ID (used for graphId parameter in other tools)

    • name: Graph name

    • description: Graph description

    • type: Graph type

    • status: Graph status

    • nodesCount: Number of nodes

    • edgesCount: Number of edges

    • createdAt: Creation time

    • updatedAt: Update time

    • publishedAt: Publication time (if published)

    • nodes: Node list, each node contains:

      • id: Node ID (used for add_edge and get_node_details tools)

      • name: Node name

      • type: Node type

get_node_details

Get detailed information about a specific node in the graph. This tool must be used in conjunction with the list_graphs tool, as the nodeId must be obtained from the list_graphs response. Use cases:

  1. View complete node attributes

  2. Check associated resources (SVG/Markdown)

  3. Analyze node relationships with others

  4. Check current state before modifying a node

Usage recommendations:

  1. First call list_graphs to get the node list of the target graph

  2. Get the required nodeId from the returned nodes array

  3. Use the obtained graphId and nodeId to call this tool

  4. Check the returned relationship data to determine if further action is needed

Return data:

  • data: Node details

    • id: Node ID

    • name: Node name

    • type: Node type

    • description: Node description

    • filePath: Associated file path

    • metadata: Node metadata

    • resources: Associated resource list

      • id: Resource ID

      • type: Resource type (svg/markdown)

      • title: Resource title

    • relationships: Relationship list

      • id: Edge ID

      • type: Edge type

      • targetNode: Target node information

get_creation_guidelines

Get creation guidelines and standards for SVG graphics and Markdown documents. This tool is a prerequisite for the save_resource tool and must be called before creating and saving any resources. Use cases:

  1. Get drawing standards before creating SVG visualizations

  2. Get format requirements before creating Markdown documents

  3. Get complete guidelines before batch resource creation

Usage recommendations:

  1. Call this tool before starting any resource creation

  2. Carefully read and follow the naming rules and directory structure

  3. Create resources according to guidelines, then use save_resource tool

  4. Recommended to save guidelines for team reference

Return data:

  • data: Guidelines content

    • guidelines: Guidelines text content

      • File naming rules

      • Directory structure requirements

      • Format specifications

      • Style guide

    • type: Guidelines type (svg/markdown/all)

    • version: Guidelines version

save_resource

Save AI-generated SVG graphics or Markdown documents to the knowledge graph. This tool must be used in conjunction with get_creation_guidelines and list_graphs tools. Use cases:

  1. Save SVG visualization representation of the graph

  2. Save Markdown documents related to nodes

  3. Batch save multiple resource files

Usage recommendations:

  1. First call get_creation_guidelines to get resource creation standards

  2. Use list_graphs to get target graph ID and node ID (if needed)

  3. Create resource content according to standards

  4. Use this tool to save the resource

  5. After saving, use get_node_details to check resource association status

Return data:

  • data: Saved resource information

    • id: Resource ID

    • type: Resource type (svg/markdown)

    • title: Resource title

    • description: Resource description

    • nodeId: Associated node ID (if any)

    • createdAt: Creation time

update_node

Modify nodes in the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools. Use cases:

  1. Update basic node information (name, description, etc.)

  2. Update file paths associated with nodes

  3. Update node metadata information

Usage recommendations:

  1. First call list_graphs to get target graph and node ID

  2. Use get_node_details to check current node status

  3. Only update fields that need to be modified, keep others unchanged

  4. After updating, call get_node_details again to confirm changes

Return data:

  • data: Updated node information

    • id: Node ID

    • name: Node name

    • type: Node type

    • description: Node description

    • filePath: Associated file path

    • metadata: Node metadata

    • updatedAt: Update time

update_edge

Modify edges in the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools. Use cases:

  1. Update edge label information

  2. Adjust edge weight values

  3. Update edge metadata information

Usage recommendations:

  1. First call list_graphs to get target graph information

  2. Use get_node_details to view edge list of related nodes

  3. Only update fields that need to be modified, keep others unchanged

  4. After updating, call get_node_details again to confirm changes

Return data:

  • data: Updated edge information

    • id: Edge ID

    • type: Edge type

    • sourceId: Source node ID

    • targetId: Target node ID

    • label: Edge label

    • weight: Edge weight

    • metadata: Edge metadata

    • updatedAt: Update time

delete_node

Delete nodes from the knowledge graph. This tool must be used in conjunction with list_graphs tool, and the operation cannot be undone. Use cases:

  1. Delete incorrectly created nodes

  2. Delete nodes that are no longer needed

  3. Delete redundant nodes when restructuring the graph

Usage recommendations:

  1. First call list_graphs to get target graph and node information

  2. Use get_node_details to check node's associated resources and relationships

  3. Confirm deletion won't affect other important nodes

  4. Set confirmDelete to true to confirm deletion

  5. Recommended to backup important data before deletion

Important notes:

  • Deleting a node will also delete all edges related to that node

  • If the node has associated resources, they won't be deleted but will be unlinked

Return data:

  • data: Deletion result

    • id: Deleted node ID

    • name: Node name

    • type: Node type

    • deletedAt: Deletion time

delete_edge

Delete edges from the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools, and the operation cannot be undone. Use cases:

  1. Delete incorrectly created relationships

  2. Update relationship structure between nodes

  3. Clean up redundant relationships when restructuring the graph

Usage recommendations:

  1. First call list_graphs to get target graph information

  2. Use get_node_details to get edge details

  3. Confirm deletion won't break important relationship structures

  4. Set confirmDelete to true to confirm deletion

Important notes:

  • Deleting edges won't affect related nodes

  • Need to call get_node_details again to view updated relationships

Return data:

  • data: Deletion result

    • id: Deleted edge ID

    • deletedAt: Deletion time

update_resource

Update resource information in the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools. Use cases:

  1. Modify resource title or description

  2. Update resource metadata information

  3. Improve resource documentation

Usage recommendations:

  1. First call list_graphs to get target graph information

  2. Use get_node_details to check current resource information

  3. Only update fields that need to be modified

  4. Maintain consistency in resource naming

Return data:

  • data: Updated resource information

    • id: Resource ID

    • name: Resource name

    • title: Resource title

    • description: Resource description

    • updatedAt: Update time

delete_resource

Delete resources from the knowledge graph. This tool must be used in conjunction with list_graphs and get_node_details tools, and the operation cannot be undone. Use cases:

  1. Delete outdated resource files

  2. Clean up unnecessary documents

  3. Remove incorrectly created resources

Usage recommendations:

  1. First call list_graphs to get target graph information

  2. Use get_node_details to confirm resource associations

  3. Confirm deletion won't affect other nodes

  4. Set confirmDelete to true to confirm deletion

  5. Recommended to backup important resources before deletion

Important notes:

  • Deleting a resource will also delete the physical file

  • Will automatically unlink from all nodes

  • This operation cannot be recovered

Return data:

  • data: Deletion result

    • id: Deleted resource ID

    • type: Resource type

    • deletedAt: Deletion time

unlink_resource

Unlink resource associations from nodes. This tool must be used in conjunction with list_graphs and get_node_details tools. Use cases:

  1. Adjust resource associations

  2. Remove incorrect resource associations

  3. Reorganize node resource structure

Usage recommendations:

  1. First call list_graphs to get target graph information

  2. Use get_node_details to view node's resource associations

  3. Confirm unlinking won't affect other functionality

  4. Record changes for potential re-association

Important notes:

  • Only removes association, does not delete resource

  • Resource can still be used by other nodes

  • Association can be re-established at any time

Return data:

  • data: Operation result

    • resourceId: Resource ID

    • nodeId: Node ID

    • unlinkedAt: Time when association was removed

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/aiuluna/knowledge-graph-mcp'

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