Skip to main content
Glama

get-category-notes

Retrieve articles from a specific category on note.com. Filter results by page number and sort by new or trending content.

Instructions

カテゴリーに含まれる記事一覧を取得する

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesカテゴリー名(例: tech)
pageNoページ番号
sortNoソート方法(new: 新着順, trend: 人気順)new

Implementation Reference

  • Handler function that fetches category notes from the note API, formats them into a structured response including id, title, excerpt, user info, publish date, likes, and URL, handles pagination and sorting, and manages errors.
    async ({ category, page, sort }) => {
      try {
        const data = await noteApiRequest(`/v1/categories/${category}?note_intro_only=true&sort=${sort}&page=${page}`);
    
        let formattedNotes: any[] = [];
        if (data.data && data.data.notes && Array.isArray(data.data.notes)) {
          formattedNotes = data.data.notes.map((note: any) => ({
            id: note.id || "",
            title: note.name || "",
            excerpt: note.body ? (note.body.length > 100 ? note.body.substring(0, 100) + '...' : note.body) : '本文なし',
            user: {
              nickname: note.user?.nickname || "",
              urlname: note.user?.urlname || ""
            },
            publishedAt: note.publishAt || '日付不明',
            likesCount: note.likeCount || 0,
            url: `https://note.com/${note.user?.urlname || ''}/n/${note.key || ''}`
          }));
        }
    
        return createSuccessResponse({
          category,
          page,
          notes: formattedNotes
        });
      } catch (error) {
        return handleApiError(error, "カテゴリー記事取得");
      }
    }
  • Input schema using Zod for validating category name, page number (default 1), and sort order (new or trend, default new).
    {
      category: z.string().describe("カテゴリー名(例: tech)"),
      page: z.number().default(1).describe("ページ番号"),
      sort: z.enum(["new", "trend"]).default("new").describe("ソート方法(new: 新着順, trend: 人気順)"),
    },
  • Registers the 'get-category-notes' tool on the MCP server with description in Japanese: 'カテゴリーに含まれる記事一覧を取得する'.
    // 3. カテゴリー記事一覧取得ツール
    server.tool(
      "get-category-notes",
      "カテゴリーに含まれる記事一覧を取得する",

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