Skip to main content
Glama

save_draft

Save draft posts to note.com by reading titles, content, and tags from Markdown files, enabling automated content preparation.

Instructions

note.comに下書きを保存します。Markdownファイルからタイトル、本文、タグを読み取り、下書きとして保存します。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdown_pathYesMarkdownファイルのパス(タイトル、本文、タグを含む)
thumbnail_pathNoサムネイル画像のパス(オプション)
state_pathNonote.comの認証状態ファイルのパス(デフォルト: /app/.note-state.json)
screenshot_dirNoスクリーンショット保存ディレクトリ(オプション)
timeoutNoタイムアウト(ミリ秒、デフォルト: 120000)

Implementation Reference

  • Handler for the 'save_draft' tool: parses arguments with SaveDraftSchema and invokes postToNote function with isPublic set to false to save as draft.
    if (name === 'save_draft') {
      const params = SaveDraftSchema.parse(args);
      const result = await postToNote({
        markdownPath: params.markdown_path,
        thumbnailPath: params.thumbnail_path,
        statePath: params.state_path,
        screenshotDir: params.screenshot_dir,
        timeout: params.timeout,
        isPublic: false,
      });
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Zod schema for validating input parameters of the 'save_draft' tool.
    const SaveDraftSchema = z.object({
      markdown_path: z.string().describe('Markdownファイルのパス(タイトル、本文、タグを含む)'),
      thumbnail_path: z.string().optional().describe('サムネイル画像のパス(オプション)'),
      state_path: z.string().optional().describe(`note.comの認証状態ファイルのパス(デフォルト: ${DEFAULT_STATE_PATH})`),
      screenshot_dir: z.string().optional().describe('スクリーンショット保存ディレクトリ(オプション)'),
      timeout: z.number().optional().describe(`タイムアウト(ミリ秒、デフォルト: ${DEFAULT_TIMEOUT})`),
    });
  • src/index.ts:641-670 (registration)
    Registration of the 'save_draft' tool in the TOOLS array, including name, description, and inputSchema.
    {
      name: 'save_draft',
      description: 'note.comに下書きを保存します。Markdownファイルからタイトル、本文、タグを読み取り、下書きとして保存します。',
      inputSchema: {
        type: 'object',
        properties: {
          markdown_path: {
            type: 'string',
            description: 'Markdownファイルのパス(タイトル、本文、タグを含む)',
          },
          thumbnail_path: {
            type: 'string',
            description: 'サムネイル画像のパス(オプション)',
          },
          state_path: {
            type: 'string',
            description: `note.comの認証状態ファイルのパス(デフォルト: ${DEFAULT_STATE_PATH})`,
          },
          screenshot_dir: {
            type: 'string',
            description: 'スクリーンショット保存ディレクトリ(オプション)',
          },
          timeout: {
            type: 'number',
            description: `タイムアウト(ミリ秒、デフォルト: ${DEFAULT_TIMEOUT})`,
          },
        },
        required: ['markdown_path'],
      },
    },
  • Specific logic in the shared postToNote helper function that handles saving the note as a draft (when isPublic is false), including clicking the save draft button and returning the result.
    if (!isPublic) {
      const saveBtn = page.locator('button:has-text("下書き保存"), [aria-label*="下書き保存"]').first();
      await saveBtn.waitFor({ state: 'visible', timeout });
      if (await saveBtn.isEnabled()) {
        await saveBtn.click();
        await page.locator('text=保存しました').waitFor({ timeout: 4000 }).catch(() => {});
        await page.waitForLoadState('networkidle', { timeout: 8000 }).catch(() => {});
      }
    
      await page.screenshot({ path: screenshotPath, fullPage: true });
      const finalUrl = page.url();
      log('Draft saved', { url: finalUrl });
    
      await context.close();
      await browser.close();
    
      return {
        success: true,
        url: finalUrl,
        screenshot: screenshotPath,
        message: '下書きを保存しました',
      };
Behavior2/5

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

With no annotations provided, the description carries full burden but only states basic functionality. It doesn't disclose behavioral traits like authentication needs (implied by 'state_path'), potential side effects, error handling, or rate limits, leaving 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Japanese that front-loads the core purpose. It could be slightly more structured but avoids redundancy and is appropriately sized for the tool's complexity.

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 doesn't explain what happens on success/failure, return values, or important constraints like authentication requirements, leaving the agent with insufficient context for reliable use.

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 parameters are well-documented in the schema. The description adds minimal value by mentioning Markdown file content (title, body, tags) and optional thumbnail, but doesn't elaborate beyond what the schema provides, meeting the baseline for high coverage.

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 ('保存します' - saves) and resource ('下書き' - draft) on 'note.com', specifying it reads from a Markdown file containing title, body, and tags. It distinguishes from sibling 'publish_note' by focusing on draft saving rather than publishing, though not explicitly contrasting them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when you have a Markdown file to save as a draft, but lacks explicit guidance on when to use this versus 'publish_note' or other alternatives. It mentions optional parameters but doesn't clarify prerequisites or exclusions.

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/Go-555/note-post-mcp'

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