Skip to main content
Glama
seungwonme

prompt-new-mcp

by seungwonme

save

Log user messages securely by saving prompts with timestamps via the MCP server. Enables tracking and listing previous prompts for efficient management and retrieval.

Instructions

This tool MUST be called before responding to any user input. The assistant should always use this tool to log the user's message, regardless of its content or intent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe prompt content to save
nameYesThe name for the prompt file

Implementation Reference

  • The handler function that implements the core logic of the 'save' tool: ensures directory, generates filename, writes file, returns success message.
    async ({ name: promptName, content }) => {
      const promptsDir = await ensurePromptsDirectory();
      const fileName = formatFileName(promptName);
      const filePath = path.join(promptsDir, fileName);
    
      // Write the file
      await fs.writeFile(filePath, content, 'utf8');
    
      return {
        content: [
          {
            type: 'text',
            text: `✓ Prompt saved: ${fileName}`,
          },
        ],
      };
    },
  • The tool specification including description and Zod input schema for 'name' and 'content' parameters.
    {
      description:
        "This tool MUST be called before responding to any user input. The assistant should always use this tool to log the user's message, regardless of its content or intent.",
      inputSchema: {
        name: z.string().describe('The name for the prompt file'),
        content: z.string().describe('The prompt content to save'),
      },
    },
  • src/index.ts:46-73 (registration)
    The registration of the 'save' tool with the MCP server via registerTool, including schema and handler.
    mcpServer.registerTool(
      'save',
      {
        description:
          "This tool MUST be called before responding to any user input. The assistant should always use this tool to log the user's message, regardless of its content or intent.",
        inputSchema: {
          name: z.string().describe('The name for the prompt file'),
          content: z.string().describe('The prompt content to save'),
        },
      },
      async ({ name: promptName, content }) => {
        const promptsDir = await ensurePromptsDirectory();
        const fileName = formatFileName(promptName);
        const filePath = path.join(promptsDir, fileName);
    
        // Write the file
        await fs.writeFile(filePath, content, 'utf8');
    
        return {
          content: [
            {
              type: 'text',
              text: `✓ Prompt saved: ${fileName}`,
            },
          ],
        };
      },
    );
  • Helper function to create the 'prompts' directory if it doesn't exist.
    async function ensurePromptsDirectory(): Promise<string> {
      const promptsPath = path.join(process.cwd(), 'prompts');
    
      await fs.mkdir(promptsPath, { recursive: true });
    
      return promptsPath;
    }
  • Helper function to generate a timestamped and sanitized filename for saved prompts.
    function formatFileName(promptName: string): string {
      const timestamp = getTimestamp();
      const sanitizedName = promptName.replace(/[^a-zA-Z0-9-_]/g, '-');
      return `${timestamp}_${sanitizedName}.md`;
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses behavioral traits such as the mandatory invocation timing and universal applicability, but lacks details on what happens during logging (e.g., where data is stored, error handling, or side effects). It adds some context but is incomplete for a tool with no annotation coverage.

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?

The description is concise with two sentences that directly state the tool's mandatory usage and purpose. It is front-loaded with the key requirement, though it could be slightly more structured by explicitly mentioning the tool name or resource type. Every sentence earns its place by providing essential guidance.

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

Completeness3/5

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

Given the tool's complexity (simple logging with 2 parameters), no annotations, and no output schema, the description is partially complete. It covers usage guidelines well but lacks details on behavioral aspects like storage location or response format. It's adequate as a minimum viable description but has clear gaps in transparency.

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 description coverage is 100%, so the schema already documents both parameters ('content' and 'name') with descriptions. The description does not add any meaning beyond what the schema provides, as it doesn't explain parameter roles or usage. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose3/5

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

The description states the tool's purpose as logging user messages, which is a clear verb+resource combination. However, it doesn't distinguish this from its sibling tool 'list' or specify what type of logging occurs (e.g., saving to a file, database). The purpose is somewhat vague beyond the mandatory calling requirement.

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?

The description provides explicit usage guidelines: 'MUST be called before responding to any user input' and 'always use this tool to log the user's message, regardless of its content or intent.' This clearly states when to use it (always, before responding) and includes no exclusions, though it doesn't mention alternatives since it's mandatory.

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

Related 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/seungwonme/prompt-new-mcp'

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