Skip to main content
Glama

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

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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "course_feature_id": { "description": "特徴ID", "type": "number" }, "desired_teaching_period": { "description": "指導期間 (monthly: 長期, once: 短期)", "enum": [ "monthly", "once" ], "type": "string" }, "grade_ids": { "description": "学年IDの配列", "items": { "type": "number" }, "type": "array" }, "sort": { "description": "ソート順", "enum": [ "pr", "certification", "rating", "lesson_count", "latest" ], "type": "string" }, "subject_ids": { "description": "科目IDの配列", "items": { "type": "number" }, "type": "array" } }, "type": "object" }

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 }; } } );

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