Skip to main content
Glama
TeXmeijin

Manalink MCP Server

by TeXmeijin

search_teachers_advanced

Filter and sort teachers on Manalink by subject, grade level, teaching features, desired period, and criteria like certification or ratings for precise tutor matching.

Instructions

科目、学年、特徴、ソート順、指導期間を指定して先生を検索します

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
course_feature_idNo特徴ID
desired_teaching_periodNo指導期間 (monthly: 長期, once: 短期)
grade_idsNo学年IDの配列
sortNoソート順
subject_idsNo科目IDの配列

Implementation Reference

  • Core handler function that implements the advanced teacher search by building query parameters, fetching HTML from manalink.jp, extracting body content, and converting to Markdown.
    export async function searchTeachers(params: TeacherSearchParams): Promise<{ bodyContent: string, markdown: string, url: string }> {
      try {
        // URLパラメータを構築
        const queryParams = new URLSearchParams();
    
        // 各パラメータを適切に設定
        if (params.grade_ids && params.grade_ids.length > 0) {
          queryParams.set('target_grade', params.grade_ids[0].toString());
        }
    
        if (params.subject_ids && params.subject_ids.length > 0) {
          queryParams.set('subject_ids', params.subject_ids.join(','));
        }
    
        if (params.course_feature_id) {
          queryParams.set('course_feature_id', params.course_feature_id.toString());
        }
    
        if (params.sort) {
          queryParams.set('sort', params.sort);
        }
    
        if (params.desired_teaching_period) {
          queryParams.set('desired_teaching_period', params.desired_teaching_period);
        }
    
        // 必ずwithout_fully_booked=true
        queryParams.set('without_fully_booked', 'true');
    
        // 検索URLを構築
        const searchUrl = `${MANALINK_BASE_URL}/teacher/search/filter?${queryParams.toString()}`;
    
        // HTMLを取得
        const html = await fetchHTML(searchUrl);
    
        // bodyタグの内容を抽出
        const bodyContent = extractBodyContent(html);
    
        // HTMLをMarkdownに変換
        const markdown = convertHtmlToMarkdown(bodyContent);
    
        // bodyコンテンツとURLとMarkdownを返す
        return {
          bodyContent,
          markdown,
          url: searchUrl
        };
      } catch (error) {
        console.error('先生検索に失敗しました:', error);
        throw new Error('先生検索に失敗しました');
      }
    }
  • TypeScript interface defining the input parameters for the searchTeachers function, matching the tool's input schema.
    export interface TeacherSearchParams {
      subject_ids?: number[];
      grade_ids?: number[];
      course_feature_id?: number;
      sort?: 'pr' | 'certification' | 'rating' | 'lesson_count' | 'latest';
      desired_teaching_period?: 'monthly' | 'once';
    }
  • src/server.ts:79-109 (registration)
    MCP tool registration including name, description, Zod input schema validation, and handler that calls searchTeachers and returns markdown content.
    server.tool(
      "search_teachers_advanced",
      "科目、学年、特徴、ソート順、指導期間を指定して先生を検索します",
      {
        subject_ids: z.array(z.number()).optional().describe("科目IDの配列"),
        grade_ids: z.array(z.number()).optional().describe("学年IDの配列"),
        course_feature_id: z.number().optional().describe("特徴ID"),
        sort: z.enum(['pr', 'certification', 'rating', 'lesson_count', 'latest']).optional().describe("ソート順"),
        desired_teaching_period: z.enum(['monthly', 'once']).optional().describe("指導期間 (monthly: 長期, once: 短期)")
      },
      async (params) => {
        try {
          const result = await searchTeachers(params as TeacherSearchParams);
          return {
            content: [{
              type: "text" as const,
              text: result.markdown.slice(0, 30000)
            }]
          };
        } catch (error) {
          console.error('先生検索に失敗しました:', error);
          return {
            content: [{
              type: "text" as const,
              text: `エラーが発生しました: ${error instanceof Error ? error.message : '不明なエラー'}`
            }],
            isError: true
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states what parameters can be specified for searching, without mentioning whether this is a read-only operation, what permissions might be required, how results are returned (pagination, format), or any rate limits. For a search tool with 5 parameters and no annotation coverage, this is inadequate.

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 in Japanese that directly states the tool's function with zero wasted words. It's appropriately sized and front-loaded with the core purpose.

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 search tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the result format, pagination, error conditions, or how empty/multiple parameters affect the search. The agent lacks sufficient context to use this tool effectively beyond basic parameter passing.

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?

The schema description coverage is 100%, so all parameters are documented in the schema itself. The description lists the parameter categories (subject, grade, features, sort order, teaching period) but doesn't add meaningful semantic context beyond what the schema already provides, such as explaining how these filters interact or providing usage examples.

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 tool's purpose as searching for teachers with specific criteria (subject, grade, features, sort order, teaching period), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like get_course_features, get_grade_master, or get_subject_master, which appear to be metadata retrieval tools rather than teacher search tools.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, constraints, or comparison with sibling tools, leaving the agent to infer usage context solely from the tool name and parameters.

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

Related 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/TeXmeijin/manalinkMCP'

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