@mseep/atlas-mcp-server
Version:
A Model Context Protocol (MCP) server for ATLAS, a Neo4j-powered task management system for LLM Agents - implementing a three-tier architecture (Projects, Tasks, Knowledge) to manage complex workflows.
21 lines (20 loc) • 641 B
JavaScript
import { nanoid } from 'nanoid';
/**
* Generates a unique, URL-friendly, 6-character alphanumeric ID.
* Uses nanoid's default alphabet (A-Za-z0-9_-).
*
* @returns A 6-character string ID.
*/
export function generateShortId() {
return nanoid(6);
}
/**
* Generates a unique ID with a specified prefix and length.
*
* @param prefix - The prefix for the ID (e.g., 'prj', 'tsk', 'knw').
* @param length - The desired length of the random part of the ID (default: 10).
* @returns A prefixed ID string (e.g., 'prj_aBcDeFgHiJ').
*/
export function generatePrefixedId(prefix, length = 10) {
return `${prefix}_${nanoid(length)}`;
}