Skip to main content
Glama

get_directions

Retrieve all educational specializations and directions from Swedish education data to filter programs and explore study options.

Instructions

Hämta alla inriktningar för utbildningar.

ANVÄNDNINGSFALL:

  • Se specialiseringar

  • Filtrera utbildningar

  • Utforska inriktningar

RETURNERAR: Lista över inriktningar.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'get_directions' MCP tool. Fetches directions (inriktningar) data from the Planned Education API and returns formatted JSON text content or error message.
    export async function getDirections() {
      try {
        const response = await plannedEducationApi.getDirections();
    
        if (response.status !== 'OK') {
          throw new Error(response.message || 'Okänt fel från API');
        }
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify(response.body, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text' as const,
              text: `Fel vid hämtning av inriktningar: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
  • Zod schema definition for the get_directions tool (currently empty).
    export const getDirectionsSchema = {};
  • Central tool registry in HTTP server where 'get_directions' is registered and mapped to the getDirections handler function.
    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,
    };
  • API client helper method invoked by the tool handler to retrieve directions data from the Planned Education API endpoint '/v3/support/programs'.
    async getDirections(): Promise<ApiResponse<SupportDataResponse>> {
      return this.get<ApiResponse<SupportDataResponse>>('/v3/support/programs');
    }
  • Import statement bringing the getDirections handler into the HTTP server for registration.
    import { getEducationAreas, getDirections } from './tools/planned-education/support-data.js';

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/isakskogstad/skolverket-syllabus-mcp'

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