Server Version
system.versionRetrieve the kObsidian server's package name, semver version, and runtime details for health checks. Read-only with zero side effects.
Instructions
Return the running kObsidian server's package name, semver version, host runtime (bun or node), and runtime version. Use this as a health-check or to confirm which server build a client is talking to. Read-only; zero side effects.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | npm package name of the running server. | |
| version | Yes | Semver version. | |
| runtime | Yes | Which runtime is executing the server. | |
| runtimeVersion | Yes | Version of the runtime (bun or node). | |
| summary | Yes | Human-readable one-liner combining the fields above. |
Implementation Reference
- src/server/tools/system.ts:26-39 (handler)The handler function for system.version tool. It returns package name, version, runtime (bun/node), runtime version, and a human-readable summary.
handler: async () => { const runtime: "bun" | "node" = isBun ? "bun" : "node"; const runtimeVersion = isBun ? ((process.versions as { bun?: string }).bun ?? "unknown") : process.version; return { name: PACKAGE_NAME, version: PACKAGE_VERSION, runtime, runtimeVersion, summary: `${PACKAGE_NAME} ${PACKAGE_VERSION} on ${runtime} ${runtimeVersion}`, }; }, }, - src/server/tools/system.ts:7-15 (schema)Output schema definition for system.version, validating the returned object with name, version, runtime, runtimeVersion, and summary fields.
const versionOutputSchema = z .object({ name: z.string().describe("npm package name of the running server."), version: z.string().describe("Semver version."), runtime: z.enum(["bun", "node"]).describe("Which runtime is executing the server."), runtimeVersion: z.string().describe("Version of the runtime (bun or node)."), summary: z.string().describe("Human-readable one-liner combining the fields above."), }) .describe("Return shape for `system.version`."); - src/server/tools/system.ts:17-40 (registration)Registration of the system.version tool as part of the systemTools array, defining name, title, description, input/output schemas, annotations, and handler.
export const systemTools: ToolDefinition[] = [ { name: "system.version", title: "Server Version", description: "Return the running kObsidian server's package name, semver version, host runtime (`bun` or `node`), and runtime version. Use this as a health-check or to confirm which server build a client is talking to. Read-only; zero side effects.", inputSchema: z.object({}).strict(), outputSchema: versionOutputSchema, annotations: READ_ONLY, handler: async () => { const runtime: "bun" | "node" = isBun ? "bun" : "node"; const runtimeVersion = isBun ? ((process.versions as { bun?: string }).bun ?? "unknown") : process.version; return { name: PACKAGE_NAME, version: PACKAGE_VERSION, runtime, runtimeVersion, summary: `${PACKAGE_NAME} ${PACKAGE_VERSION} on ${runtime} ${runtimeVersion}`, }; }, }, ]; - src/server/registry.ts:18-34 (registration)Global tool registry that imports and spreads systemTools (including system.version) into the combined tool list.
export const toolRegistry: ToolDefinition[] = [ ...vaultTools, ...noteTools, ...tagTools, ...linkTools, ...analyticsTools, ...taskTools, ...dataviewTools, ...blocksTools, ...marpTools, ...kanbanTools, ...canvasTools, ...templateTools, ...apiTools, ...wikiTools, ...systemTools, ]; - src/config/package-version.ts:1-4 (helper)Helper that reads PACKAGE_NAME and PACKAGE_VERSION from package.json, used by the handler to populate name and version fields.
import pkg from "../../package.json" with { type: "json" }; export const PACKAGE_NAME: string = pkg.name; export const PACKAGE_VERSION: string = pkg.version;