Skip to main content
Glama
maoruibin

MCP-Server-Inbox

by maoruibin

write_note

Create notes in your inbox using markdown format with optional titles through conversation-based interactions.

Instructions

Write note to inBox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNoOptional title of the note
contentYesText content of the note with markdown format

Implementation Reference

  • MCP tool handler for 'write_note': extracts title and content from request, validates, initializes InboxClient with user token, calls writeNote, formats and returns success response.
    case "write_note": {
      const content = String(request.params.arguments?.content);
      const title = request.params.arguments?.title ? String(request.params.arguments.title) : undefined;
      
      if (!content) {
        throw new Error("Content is required");
      }
    
      // 获取用户Token,优先使用命令行参数,其次使用环境变量
      const userToken = args.inbox_user_token || process.env.INBOX_USER_TOKEN;
      if (!userToken) {
        throw new Error("inBox token or URL not set. Please provide it via:\n" +
          "1. Token format: --inbox_user_token=your_token\n" +
          "2. URL format: --inbox_user_token=https://inbox.gudong.site/api/inbox/your_token");
      }
    
      // 创建inBox客户端并写入笔记
      const inbox = new InboxClient({ userToken });
      const result = await inbox.writeNote({ title, content });
    
      // 返回成功信息
      let successMessage = `笔记已成功保存到inBox!`;
      if (title) {
        successMessage += `\n\n标题: ${title}`;
      }
      successMessage += `\n\n${content.substring(0, 50)}${content.length > 50 ? '...' : ''}`;
      
      return {
        content: [
          {
            type: "text",
            text: successMessage
          },
        ],
      };
    }
  • src/index.ts:56-79 (registration)
    Registers the 'write_note' tool in ListToolsRequestHandler, including name, description, and input schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: "write_note",
            description: "Write note to inBox",
            inputSchema: {
              type: "object",
              properties: {
                title: {
                  type: "string",
                  description: "Optional title of the note",
                },
                content: {
                  type: "string",
                  description: "Text content of the note with markdown format",
                },
              },
              required: ["content"],
            },
          },
        ],
      };
    });
  • Input schema definition for the 'write_note' tool: object with optional 'title' string and required 'content' string.
    {
      name: "write_note",
      description: "Write note to inBox",
      inputSchema: {
        type: "object",
        properties: {
          title: {
            type: "string",
            description: "Optional title of the note",
          },
          content: {
            type: "string",
            description: "Text content of the note with markdown format",
          },
        },
        required: ["content"],
      },
    },
  • Helper method in InboxClient that performs the actual POST request to inBox API to create a note with title and content.
    async writeNote({ title, content }: { title?: string; content: string }) {
      try {
        if (!content) {
          throw new Error("invalid content");
        }
    
        // 检查内容长度
        if (content.length > 3000) {
          throw new Error("note content exceeds 3000 characters limit");
        }
    
        // 构建请求体,直接传递 title 和 content 参数
        const req: { content: string; title?: string } = {
          content,
        };
    
        // 如果有title参数,添加到请求中
        if (title) {
          req.title = title;
        }
    
        const resp = await fetch(this.apiUrl, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
          },
          body: JSON.stringify(req),
        });
    
        if (!resp.ok) {
          throw new Error(`request failed with status ${resp.statusText}`);
        }
    
        return resp.json();
      } catch (e) {
        throw e;
      }
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose permissions needed, side effects, error conditions, or response format. 'Write' implies mutation, but no further context is given.

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 with no wasted words. It is appropriately sized for a simple tool and front-loaded with the core action.

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 no annotations and no output schema, the description is incomplete. It lacks behavioral context, usage guidelines, and details on what happens after writing (e.g., success response, error handling). The high schema coverage doesn't compensate for these gaps.

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?

Schema description coverage is 100%, so the schema fully documents parameters (title and content). The description adds no parameter semantics beyond what the schema provides, meeting the baseline of 3 for high coverage.

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 'Write note to inBox' states the action (write) and target (note to inBox), but is vague about what 'inBox' refers to (a specific location, application, or system). It doesn't distinguish from siblings since none exist, but the purpose lacks specificity beyond basic verb+resource.

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?

No guidance is provided on when to use this tool, such as prerequisites, alternatives, or context. The description only states what it does, with no indication of appropriate scenarios or limitations.

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/maoruibin/mcp-server-inbox'

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