Skip to main content
Glama

Rename Artifact

rename_artifact

Change the display label of an artifact in a Mnemosyne knowledge graph by specifying the graph ID, artifact ID, and new label.

Instructions

Rename an artifact's display label.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
graph_idYes
artifact_idYes
new_labelYes

Implementation Reference

  • The @server.tool decorator registers the tool and defines its metadata (name, title, description). The async rename_artifact_tool function is the core handler that authenticates, validates inputs, verifies the artifact exists in the workspace, performs the rename via Y.js WorkspaceWriter.update_artifact in a transaction, fetches updated workspace snapshot, and returns success response with details.
    @server.tool(
        name="rename_artifact",
        title="Rename Artifact",
        description="Rename an artifact's display label.",
    )
    async def rename_artifact_tool(
        graph_id: str,
        artifact_id: str,
        new_label: str,
        context: Context | None = None,
    ) -> dict:
        """Rename an artifact via Y.js."""
        auth = MCPAuthContext.from_context(context)
        auth.require_auth()
    
        if not graph_id or not graph_id.strip():
            raise ValueError("graph_id is required and cannot be empty")
        if not artifact_id or not artifact_id.strip():
            raise ValueError("artifact_id is required and cannot be empty")
        if not new_label or not new_label.strip():
            raise ValueError("new_label is required and cannot be empty")
    
        try:
            await hp_client.connect_workspace(graph_id.strip())
    
            # Verify artifact exists
            channel = hp_client._workspace_channels.get(graph_id.strip())
            if channel is None:
                raise RuntimeError(f"Workspace not connected: {graph_id}")
    
            reader = WorkspaceReader(channel.doc)
            current = reader.get_artifact(artifact_id.strip())
    
            if not current:
                raise RuntimeError(f"Artifact '{artifact_id}' not found in graph '{graph_id}'")
    
            # Update artifact name via Y.js
            await hp_client.transact_workspace(
                graph_id.strip(),
                lambda doc: WorkspaceWriter(doc).update_artifact(
                    artifact_id.strip(),
                    name=new_label.strip(),
                ),
            )
    
            snapshot = hp_client.get_workspace_snapshot(graph_id.strip())
    
            result = {
                "success": True,
                "artifact_id": artifact_id.strip(),
                "graph_id": graph_id.strip(),
                "new_label": new_label.strip(),
                "workspace": snapshot,
            }
            return result
    
        except Exception as e:
            logger.error(
                "Failed to rename artifact",
                extra_context={
                    "graph_id": graph_id,
                    "artifact_id": artifact_id,
                    "error": str(e),
                },
            )
            raise RuntimeError(f"Failed to rename artifact: {e}")
  • The register_hocuspocus_tools function is called during server creation to register all hocuspocus tools, including rename_artifact, to the FastMCP server instance.
    register_hocuspocus_tools(mcp_server)
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 the tool performs a rename operation but doesn't specify whether this requires specific permissions, if the change is reversible, what happens to references to the artifact, or what the response looks like. This leaves significant gaps for a mutation tool.

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 directly states the tool's purpose with zero wasted words. It's appropriately sized for a simple rename operation.

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 mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain parameter meanings, behavioral implications, or what to expect after invocation, leaving the agent with insufficient context.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides only parameter names without meaning. The description mentions 'artifact's display label' which hints at 'new_label' but doesn't explain 'graph_id' or 'artifact_id' parameters. It adds minimal value beyond what's inferable from the tool name.

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 verb ('rename') and resource ('artifact's display label'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'rename_folder', which performs a similar operation on a different resource type.

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 like 'move_artifact' or 'update_block', nor does it mention prerequisites or constraints. The agent must infer usage from the tool name alone.

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/sophia-labs/mnemosyne-mcp'

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