Skip to main content
Glama

get_subject_versions

Retrieve all available versions of a Swedish curriculum subject to track changes over time, compare current and previous versions, and analyze curriculum development progression.

Instructions

Hämta alla tillgängliga versioner av ett ämne.

ANVÄNDNINGSFALL:

  • Följa hur ett ämne förändrats över tid

  • Jämföra nuvarande läroplan med tidigare versioner

  • Forskning om läroplansförändringar

  • Förstå progressionen i ämnets utveckling

RETURNERAR: Lista över alla versioner med versionsnummer och giltighetsdatum.

TIPS: Använd sedan get_subject_details med specifikt versionsnummer för att jämföra.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Implementation Reference

  • The main handler function for the 'get_subject_versions' tool. It calls the syllabus API to fetch versions for a given subject code and returns a formatted JSON response or error message.
    export async function getSubjectVersions(params: {
      code: string;
    }) {
      try {
        const versions = await syllabusApi.getSubjectVersions(params.code);
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify({
                code: params.code,
                totalVersions: versions.totalElements,
                versions: versions.versions
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text' as const,
              text: `Fel vid hämtning av ämnesversioner: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema defining the parameters for the get_subject_versions tool (requires 'code' string).
    export const getSubjectVersionsSchema = {
      code: z.string().describe('Ämneskod att hämta versioner för')
    };
  • Registration of the getSubjectVersions handler function as the 'get_subject_versions' tool in the HTTP server's tools registry.
    get_subject_versions: getSubjectVersions,
  • Import of the getSubjectVersions handler from the subjects tools module.
    import { searchSubjects, getSubjectDetails, getSubjectVersions } from './tools/syllabus/subjects.js';
  • Syllabus API client method that performs the actual HTTP GET request to retrieve subject versions from Skolverket's API.
    async getSubjectVersions(code: string): Promise<VersionsResponse> {
      return this.get<VersionsResponse>(`/v1/subjects/${code}/versions`);
    }

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