Skip to main content
Glama

get-note

Retrieve detailed article information from note.com by providing the article ID to access content and metadata.

Instructions

記事の詳細情報を取得する

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteIdYes記事ID(例: n4f0c7b884789)

Implementation Reference

  • The core handler function for the 'get-note' tool. It makes an API request to retrieve note details, including drafts, logs the raw response for debugging, formats the note data using formatNote utility, and returns a formatted success response or handles errors.
    async ({ noteId }) => {
      try {
        const params = new URLSearchParams({
          draft: "true",
          draft_reedit: "false",
          ts: Date.now().toString()
        });
    
        const data = await noteApiRequest(
          `/v3/notes/${noteId}?${params.toString()}`,
          "GET",
          null,
          true
        );
    
        const noteData = data.data || {};
    
        // デバッグ用にAPIレスポンスをログ出力
        console.log('Raw API response from note-tools:', JSON.stringify(noteData, null, 2));
    
        // formatNote関数を使って完全なレスポンスを生成
        const formattedNote = formatNote(
          noteData,
          noteData.user?.urlname || '',
          true, // includeUserDetails
          true  // analyzeContent
        );
    
        return createSuccessResponse(formattedNote);
      } catch (error) {
        return handleApiError(error, "記事取得");
      }
    }
  • Zod schema defining the input parameters for the 'get-note' tool: a required 'noteId' string parameter with description.
    {
      noteId: z.string().describe("記事ID(例: n4f0c7b884789)"),
    },
  • Complete registration of the 'get-note' tool within the registerNoteTools function using McpServer.tool(). Includes tool name, Japanese description, input schema, and handler implementation.
    server.tool(
      "get-note",
      "記事の詳細情報を取得する",
      {
        noteId: z.string().describe("記事ID(例: n4f0c7b884789)"),
      },
      async ({ noteId }) => {
        try {
          const params = new URLSearchParams({
            draft: "true",
            draft_reedit: "false",
            ts: Date.now().toString()
          });
    
          const data = await noteApiRequest(
            `/v3/notes/${noteId}?${params.toString()}`,
            "GET",
            null,
            true
          );
    
          const noteData = data.data || {};
    
          // デバッグ用にAPIレスポンスをログ出力
          console.log('Raw API response from note-tools:', JSON.stringify(noteData, null, 2));
    
          // formatNote関数を使って完全なレスポンスを生成
          const formattedNote = formatNote(
            noteData,
            noteData.user?.urlname || '',
            true, // includeUserDetails
            true  // analyzeContent
          );
    
          return createSuccessResponse(formattedNote);
        } catch (error) {
          return handleApiError(error, "記事取得");
        }
      }
    );
  • Invocation of registerNoteTools(server) in the central registerAllTools function, which registers the 'get-note' tool among others.
    registerNoteTools(server);

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/shimayuz/note-com-mcp'

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