get_subject_details
Retrieve detailed information about specific school subjects including core content, knowledge requirements, course structure, and progression to support lesson planning and curriculum analysis.
Instructions
Hämta detaljerad information om ett specifikt ämne.
ANVÄNDNINGSFALL:
Se centralt innehåll för ett ämne
Granska ämnesspecifika kunskapskrav
Förstå ämnets uppbyggnad och progression
Planera undervisning
RETURNERAR: Komplett ämnesinformation med alla detaljer, inkl. kurser som ingår.
EXEMPEL: Använd code="GRGRMAT01" för Matematik i grundskolan.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| version | No |
Implementation Reference
- src/tools/syllabus/subjects.ts:77-103 (handler)The main handler function that executes the tool logic: fetches subject details via syllabusApi.getSubject and returns a formatted JSON response or error message.export async function getSubjectDetails(params: { code: string; version?: number; date?: string; }) { try { const subject = await syllabusApi.getSubject(params.code, params.version, params.date); return { content: [ { type: 'text' as const, text: JSON.stringify(subject, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Fel vid hämtning av ämnesdetaljer: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; }
- src/tools/syllabus/subjects.ts:17-21 (schema)Zod schema defining the input parameters for the get_subject_details tool: code (required), version (optional), date (optional).export const getSubjectDetailsSchema = { code: z.string().describe('Ämneskod (t.ex. "GRGRMAT01" för matematik i grundskolan)'), version: z.number().optional().describe('Versionsnummer (lämna tomt för senaste versionen)'), date: z.string().optional().describe('Datum i formatet YYYY-MM-DD för att hämta versionen som var giltig vid det datumet') };
- src/http-server.ts:51-87 (registration)Registration of the tool in the central tools registry object, mapping 'get_subject_details' to the getSubjectDetails handler function. Imported from './tools/syllabus/subjects.js' at line 22.const tools: Record<string, (args: any) => Promise<any>> = { // Syllabus API search_subjects: searchSubjects, get_subject_details: getSubjectDetails, get_subject_versions: getSubjectVersions, search_courses: searchCourses, get_course_details: getCourseDetails, get_course_versions: getCourseVersions, search_programs: searchPrograms, get_program_details: getProgramDetails, get_program_versions: getProgramVersions, search_curriculums: searchCurriculums, get_curriculum_details: getCurriculumDetails, get_curriculum_versions: getCurriculumVersions, get_school_types: getSchoolTypes, get_types_of_syllabus: getTypesOfSyllabus, get_subject_and_course_codes: getSubjectAndCourseCodes, get_study_path_codes: getStudyPathCodes, get_api_info: getApiInfo, // School Units API search_school_units: searchSchoolUnits, get_school_unit_details: getSchoolUnitDetails, get_school_units_by_status: getSchoolUnitsByStatus, search_school_units_by_name: searchSchoolUnitsByName, // Planned Education API search_adult_education: searchAdultEducation, get_adult_education_details: getAdultEducationDetails, filter_adult_education_by_distance: filterAdultEducationByDistance, filter_adult_education_by_pace: filterAdultEducationByPace, get_education_areas: getEducationAreas, get_directions: getDirections, // Diagnostics health_check: healthCheck, };