Kotlin — 117 Operations for AI Agents

This page is the canonical reference an AI coding agent uses to refactor, query, and analyze Kotlin code through the act MCP server. 117 operations available: 43 refactor, 18 query, 42 analysis, 14 verification. Each operation is callable from Claude Code, Cursor, Codex, OpenCode, or any MCP-compatible agent host. Click any operation for a stable anchor link suitable for citation.

18Query
43Refactor
42Analysis
14Verify

Query

18 query tools, the same on every supported language. Descriptions live in the shared reference: /docs/query-tools.

callers control_flow data_flow definition diagnostics effect_closure effect_summary fix_auto get_type graph import_organize interface mutations references repo_outline skeleton symbols symbols_batch

Refactor

Operation Description
add-elvis-operator Add elvis operator (?:) for null safety
add-reified-type-parameter Mark type parameter as reified for runtime type access
add-safe-call Wrap member access in safe call operator (?.) for null-safe navigation
change-parameter-type Change parameter type and update call sites
change-return-type Change function return type and update signature
change-signature Modify function parameters, return, generics
convert-block-to-function-expression Convert block body function to expression body function
convert-function-expression-to-block Convert expression body function to block body function
convert-function-to-lambda Convert simple function to lambda expression
convert-lambda-to-function Convert lambda expression to named function for improved readability
convert-to-companion-object Move class-level functions/properties into companion object
convert-to-data-class Convert class to data class with auto-generated equals/hashCode
convert-to-extension-function Convert instance method to extension function
convert-to-object-declaration Convert singleton class to object declaration
convert-to-property Convert field + getter/setter to property
convert-to-scope-function Convert object usage to scope function (let/run/apply/also/with)
convert-to-sealed-class Convert class hierarchy to sealed class
convert-to-string-template Convert string concatenation to Kotlin string template
convert-to-when-expression Convert if-else chain to Kotlin when expression
encapsulate Make field private, generate getter/setter
extract-class Extract methods/fields to new class
extract-constant Extract value to named constant
extract-interface Create interface from class
extract-property Extract expression into class property with backing field
extract-type-alias Extract complex type into type alias
extract_function Extract a code selection into a new function — automatically infers parameters, return types, and inserts the call site. Use instead of manually cutting/pasting code. Works without LSP; LSP improves type inference. Params: file (string), new_name (string), start_line (u32), start_column (u32), end_line (u32), end_column (u32) [, preview (bool), receipt (bool)]
extract_variable Extract an expression into a named variable — inserts the declaration and replaces the expression with the variable name. Works without LSP. Params: file (string), new_name (string), start_line (u32), start_column (u32), end_line (u32), end_column (u32) [, preview (bool)]
generate-class-from-interface Generate a class implementation from a Kotlin interface
generate-component-accessors Generate componentN() accessors for destructuring
generate-copy-method Generate copy() method for immutable updates
generate-data-class Generate data class with auto-generated methods
generate-elvis-default Append an Elvis operator with a default value to a nullable expression
generate-method Generate a new method stub in a Kotlin class
generate-null-check-guard Generate a null-check guard wrapping a statement
generate-override-method Generate an override method stub in a Kotlin class
generate-primary-constructor Generate a primary constructor for a Kotlin class
generate-when-branches Generate when branches for enum/sealed class variants
inline Inline a variable, function, or method — replace every usage with its definition body, then remove the original. The inverse of extract. Works without LSP (single-file); LSP enables cross-file inlining. Params: file (string), symbol (string) [, line (u32), preview (bool), receipt (bool)]
insert_body Replace a function's implementation body with new code. AST-validated — rejects if the result has parse errors, so you can't accidentally break syntax. Use instead of manual text editing for function rewrites. Params: file (string), symbol (string), code (string) [, commit (bool)]
move-to-companion-object Move static-like function to companion object
move_symbol Move a function, class, or type to a different file and automatically update all imports across the codebase. Use instead of manually cut/paste + fixing imports. Works without LSP (single-file); LSP enables cross-file import updates. Params: file (string), symbol (string), destination (string) [, preview (bool), receipt (bool)]
recipe_run Run a codemod recipe: declarative match → transform → optional verify across modeled grammars. Preview lists matches; apply writes with optional E7 receipts and all-or-nothing rollback. Returns a per-site report.
rename Rename a symbol and automatically update ALL references across the codebase. Safer and faster than find-and-replace — AST-aware, won't rename strings or comments. Works without LSP (single-file); LSP enables cross-file renames. Params: file (string), old_name (string), new_name (string) [, line (u32), column (u32), preview (bool), receipt (bool)]

Analysis

42 analysis tools, the same on every supported language. Descriptions live in the shared reference: /docs/analysis-tools.

analyze_api_diff analyze_chokepoints analyze_clones analyze_clusters analyze_cohesion analyze_conformance analyze_coupling analyze_cycle_risk analyze_cycles analyze_dead_code analyze_depth analyze_entry_points analyze_export analyze_extraction analyze_fan_balance analyze_features analyze_hotspots analyze_impact analyze_inconsistencies analyze_inheritance analyze_interface_bloat analyze_interfaces analyze_layers analyze_orphan_types analyze_patterns analyze_platform_deps analyze_readiness analyze_roles analyze_seams analyze_stability analyze_surface analyze_test_gaps analyze_thickness analyze_type_completeness churn_hotspots co_change_clusters coverage_overlay ownership_map profile_overlay simulate split_module trace_overlay

Verify

14 verify tools, the same on every supported language. Descriptions live in the shared reference: /docs/verification.

bisect_regression gate generate_test_harness scan secret_surface summarize_pr taint_flow unsafe_surface verify_behavioral_equivalence verify_contract_preserved verify_diff_semantics verify_port_parity verify_side_effects verify_test_impact

← KConfigKusto/KQL →