Skip to main content
Glama

Kotlin Multiplatform (KMP) Guide

android_kmp_guide
Read-only

Provides Kotlin Multiplatform reference to share business logic across Android and iOS. Covers KMP-specific libraries, Room, Ktor, and platform code patterns.

Instructions

Complete Kotlin Multiplatform reference — shares business logic across Android and iOS. CRITICAL: AI tools silently generate Android-only code for KMP projects. Retrofit cannot be used in KMP (use Ktor). Hilt cannot be used in commonMain (use Koin). Room 2.7+ has KMP support — use room-runtime + sqlite-bundled, NOT the Android-only Room. 900+ new KMP libraries in 2025. Room, DataStore, Ktor all have KMP variants. Topics: 'overview' (project structure, Gradle setup), 'libraries' (KMP catalogue — Ktor, Room KMP, DataStore KMP, Koin, Coil3, kotlinx-*), 'room' (Room KMP database setup), 'ktor' (Ktor HTTP client — replaces Retrofit), 'expect actual' (platform-specific code pattern).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicNoTopic: 'overview', 'libraries', 'room', 'ktor', 'expect actual', 'gradle'
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already mark the tool as read-only (readOnlyHint=true). The description adds valuable behavioral context by warning about common code generation pitfalls and listing what topics are covered, without contradicting the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and critical warnings, making it efficient despite its length. Every sentence adds value (e.g., library lists, pitfalls), but it could be slightly more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool is a guide with a single parameter and no output schema, the description provides a thorough overview of its content and constraints. It covers all necessary context for an agent to understand its use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% as the single parameter 'topic' is fully described with allowed values. The description repeats those topics but does not add new semantic details beyond what the schema provides, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it is a 'Complete Kotlin Multiplatform reference' that shares business logic across Android and iOS. It distinguishes itself from sibling tools (e.g., android_testing_guide, material3_expressive) by focusing specifically on KMP and providing unique warnings about common pitfalls.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes critical usage warnings (e.g., 'AI tools silently generate Android-only code', 'Retrofit cannot be used in KMP'), which guide when to use alternatives. While it doesn't explicitly state when to use this tool vs siblings, the context of KMP guidance is clear and well-supported.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/VIKAS9793/AndroJack-mcp'

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