Skip to main content
Glama

delete_relations

Remove specified relationships between stored entities while preserving the entities themselves in the Memento memory server.

Instructions

Remove specified relations between entities without deleting the entities themselves.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relationsYesArray of relations to delete.

Implementation Reference

  • Handler function that invokes the knowledge graph manager's deleteRelations method and returns a textual success confirmation.
    async ({ relations }) => {
        await this.#knowledgeGraphManager.deleteRelations(relations);
        return { content: [{ type: 'text', text: 'Relations deleted' }] };
    }
  • Zod schema validating the input as an array of relations, each with 'from', 'to', and 'relationType' string fields.
    {
        relations: z.array(z.object({
            from:         z.string().describe('Source entity name.'),
            to:           z.string().describe('Target entity name.'),
            relationType: z.string().describe('Type of the relation to remove.')
        })).describe('Array of relations to delete.')
    },
  • src/server.js:126-140 (registration)
    MCP server tool registration call for 'delete_relations', including description, input schema, and handler.
    this.tool(
        'delete_relations',
        'Remove specified relations between entities without deleting the entities themselves.',
        {
            relations: z.array(z.object({
                from:         z.string().describe('Source entity name.'),
                to:           z.string().describe('Target entity name.'),
                relationType: z.string().describe('Type of the relation to remove.')
            })).describe('Array of relations to delete.')
        },
        async ({ relations }) => {
            await this.#knowledgeGraphManager.deleteRelations(relations);
            return { content: [{ type: 'text', text: 'Relations deleted' }] };
        }
    );
  • SQLite GraphRepository implementation of deleteRelations: iterates relations, gets entity IDs, executes DELETE SQL if both entities exist.
    async deleteRelations(relations) {
        for (const relation of relations) {
            const fromId = await this.getEntityId(relation.from);
            const toId = await this.getEntityId(relation.to);
            if (!fromId || !toId) continue;
            await this.db.run(
                `DELETE FROM relations WHERE from_id = ? AND to_id = ? AND relationType = ?`,
                [fromId, toId, relation.relationType]
            );
        }
    }
  • PostgreSQL GraphRepository implementation of deleteRelations: similar iteration, ID resolution, and DELETE query using parameterized query.
    async deleteRelations(relations) {
        for (const relation of relations) {
            const fromId = await this.getEntityId(relation.from);
            const toId = await this.getEntityId(relation.to);
            if (!fromId || !toId) {
                continue;
            }
    
            await this.#query(
                `DELETE
                 FROM relations
                 WHERE from_id = $1
                   AND to_id = $2
                   AND relationtype = $3`,
                [ fromId, toId, relation.relationType ]
            );
        }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a removal operation but doesn't describe permissions needed, whether changes are reversible, error conditions, or what happens to related data. For a destructive operation with zero annotation coverage, this leaves significant behavioral gaps.

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 a single, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized for this tool's complexity and gets straight to the point.

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?

For a destructive operation with no annotations and no output schema, the description is insufficient. It doesn't explain what 'remove' means operationally, what confirmation or side effects occur, or what the tool returns. Given the complexity of relation management, more context is needed.

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 has 100% description coverage, so the baseline is 3. The description adds no parameter-specific information beyond what's already in the schema - it doesn't explain relation types, entity naming conventions, or batch operation implications.

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 action ('Remove') and target ('relations between entities'), distinguishing it from entity deletion tools. However, it doesn't explicitly differentiate from sibling tools like 'delete_observations' or 'delete_entities', which prevents a perfect score.

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 minimal guidance by specifying 'without deleting the entities themselves', which helps differentiate from 'delete_entities'. However, it offers no explicit when-to-use rules, alternatives, or context about when this tool is appropriate versus other deletion tools.

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/iAchilles/memento'

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