Skip to main content
Glama
sifue

ZEN University Syllabus MCP Server

by sifue

get-list-of-all-subjects

Retrieve all courses from ZEN University's syllabus with essential details like name, grade requirements, quarters offered, and credits to help students plan their curriculum.

Instructions

Retrieve a simplified list of all courses from the ZEN University syllabus, containing only the essential properties (name, enrollmentGrade, quarters, credit).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that fetches all subjects using fetchAllPages, simplifies the data, formats it to text using helper functions, and returns as text content.
    async () => {
      try {
        const result = await fetchAllPages();
        
        // Extract only the required properties from each subject
        const simplifiedSubjects = result.subjects.map(subject => ({
          // code: subject.code,
          name: subject.name,
          // description: subject.description,
          // thumbnailUrl: subject.thumbnailUrl,
          openingYear: subject.openingYear,
          metadata: {
            enrollmentGrade: subject.metadata.enrollmentGrade,
            teachingMethod: subject.metadata.teachingMethod,
            subjectRequirement: subject.metadata.subjectRequirement,
            evaluationSystem: subject.metadata.evaluationSystem,
            credit: subject.metadata.credit,
            quarters: subject.metadata.quarters,
            objective: subject.metadata.objective,
            specialNotes: subject.metadata.specialNotes,
            coursePlans: subject.metadata.coursePlans || []
          },
          subjectCategoryIds: subject.subjectCategoryIds || []
        }));
    
        // テキスト形式に変換
        const formattedText = formatSimplifiedSubjectsToText(simplifiedSubjects);
        
        return {
          content: [
            {
              type: "text",
              text: formattedText,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error: ${error}`,
            },
          ],
        };
      }
    },
  • src/index.ts:212-264 (registration)
    Registration of the get-list-of-all-subjects tool with server.tool, including name, description, empty input schema, and handler function.
    server.tool(
      "get-list-of-all-subjects",
      "Retrieve a simplified list of all courses from the ZEN University syllabus, containing only the essential properties (name, enrollmentGrade, quarters, credit).",
      {},
    
      async () => {
        try {
          const result = await fetchAllPages();
          
          // Extract only the required properties from each subject
          const simplifiedSubjects = result.subjects.map(subject => ({
            // code: subject.code,
            name: subject.name,
            // description: subject.description,
            // thumbnailUrl: subject.thumbnailUrl,
            openingYear: subject.openingYear,
            metadata: {
              enrollmentGrade: subject.metadata.enrollmentGrade,
              teachingMethod: subject.metadata.teachingMethod,
              subjectRequirement: subject.metadata.subjectRequirement,
              evaluationSystem: subject.metadata.evaluationSystem,
              credit: subject.metadata.credit,
              quarters: subject.metadata.quarters,
              objective: subject.metadata.objective,
              specialNotes: subject.metadata.specialNotes,
              coursePlans: subject.metadata.coursePlans || []
            },
            subjectCategoryIds: subject.subjectCategoryIds || []
          }));
    
          // テキスト形式に変換
          const formattedText = formatSimplifiedSubjectsToText(simplifiedSubjects);
          
          return {
            content: [
              {
                type: "text",
                text: formattedText,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${error}`,
              },
            ],
          };
        }
      },
    );
  • Core helper function fetchAllPages that fetches all pages from the syllabus API, merges subjects from all pages.
    async function fetchAllPages(options?: FetchOptions) {
      // まず最初のページを取得
      const firstPageUrl = createUrl(0, options);
      const firstResponse = await fetch(firstPageUrl);
      if (!firstResponse.ok) {
        throw new Error(`APIリクエストに失敗しました: ${firstResponse.status} ${firstResponse.statusText}`);
      }
    
      const firstData = (await firstResponse.json()) as ApiResponse;
      const allSubjects = [...firstData.subjects];
      const { totalPages, totalCount, pageSize, relatedTags } = firstData;
    
      // 2ページ目以降を順次取得 (page=1 ~ totalPages-1)
      for (let page = 1; page < totalPages; page++) {
        const url = createUrl(page, options);
        const response = await fetch(url);
    
        if (!response.ok) {
          throw new Error(`APIリクエストに失敗しました: ${response.status} ${response.statusText}`);
        }
    
        const data = (await response.json()) as ApiResponse;
        allSubjects.push(...data.subjects);
      }
    
      // 単一のオブジェクトとしてまとめる
      const mergedData = {
        totalCount,
        pageSize,
        page: 0, // 全ページのデータを結合した結果なので、page=0 とする
        totalPages,
        relatedTags,
        subjects: allSubjects,
      };
    
      return mergedData;
    }
  • Helper function to format the list of simplified subjects into a readable text string.
    function formatSimplifiedSubjectsToText(subjects: any[]): string {
      let text = `検索結果: ${subjects.length}件の科目が見つかりました\n\n`;
      
      // 科目名と想定年次のリスト
      const subjectList = subjects.map(subject => formatSimplifiedSubjectToText(subject));
      
      // 1行に1科目ずつ表示
      text += subjectList.join('\n');
      
      return text;
    }
  • Helper function to get category names from subject category IDs.
    function getCategoryName(categoryIds: string[]): string {
      if (!categoryIds || categoryIds.length === 0) {
        return "未分類";
      }
    
      const categoryMap: Record<string, string> = {
        "basic": "導入科目",
        "applied_informatics": "基盤リテラシー科目 (情報)",
        "mathematical_sciences": "基盤リテラシー科目 (数理)",
        "multilingual_information_understanding": "多言語情報理解科目",
        "culture_and_thoughts": "世界理解科目 (文化・思想)",
        "society_and_networks": "世界理解科目 (社会・ネットワーク)",
        "economy_and_markets": "世界理解科目 (経済・マーケット)",
        "digital_industr": "世界理解科目 (デジタル産業)",
        "social_connection": "社会接続科目",
        "graduation_project": "卒業プロジェクト科目",
        "free": "自由科目"
      };
    
      // カテゴリーIDに対応する分類名を取得
      const categoryNames = categoryIds.map(id => categoryMap[id] || "未分類");
      
      // 重複を排除
      return [...new Set(categoryNames)].join(", ");
    }
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 the tool's behavior as a retrieval operation with a specific output format (simplified list with named properties), but lacks details about potential limitations like pagination, rate limits, authentication requirements, or error handling. The description adds some behavioral context but doesn't fully compensate for the absence of annotations.

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, well-structured sentence that efficiently communicates the tool's purpose, scope, and differentiation from siblings. Every word earns its place with no redundant information, making it appropriately sized and front-loaded.

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

Completeness4/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description provides adequate context by clearly explaining what the tool does, what it returns, and how it differs from alternatives. However, the absence of output schema means the description doesn't fully document the return structure beyond property names, leaving some ambiguity about format.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, maintaining focus on the tool's purpose and output. This meets the baseline expectation for tools with no parameters.

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

Purpose5/5

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

The description clearly states the specific action ('Retrieve'), resource ('list of all courses from the ZEN University syllabus'), and scope ('simplified list... containing only the essential properties'). It explicitly distinguishes from the sibling tool 'get-a-subject-with-detail' by emphasizing the simplified nature versus detailed information.

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 guidance on when to use this tool versus alternatives by specifying it returns 'only the essential properties' and contrasting with the sibling tool name 'get-a-subject-with-detail', which implies a more detailed alternative. It clearly indicates this tool is for simplified overviews rather than detailed information.

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/sifue/zen-syllabus-mcp'

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