Skip to main content
Glama

Scaffold Activity

scaffold_activity

Generates a new Kotlin Activity file from a template and adds it to an existing Android project, optionally creating the matching XML layout.

Instructions

Generate a new Activity Kotlin file from a template and add it to an existing Android project

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectDir": "<projectDir>",
      "activityName": "<activityName>",
      "packageName": "<packageName>"
    },
    "name": "scaffold_activity"
  }
}

Input Schema

NameRequiredDescriptionDefault
layoutNoGenerate a corresponding XML layout file
moduleNoModule nameapp
projectDirYesAbsolute path to the Android project root
packageNameYesPackage name, e.g. 'com.example.myapp'
activityNameYesActivity class name, e.g. 'DetailActivity'

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=false, so safety is largely covered. The description adds that output comes from a template and lands inside an existing project tree, but omits what an agent most needs to know: whether an existing file of the same name is overwritten, whether the Activity is registered in AndroidManifest.xml, and whether missing directories are created. Non-idempotent mutation with no overwrite semantics disclosed is a real gap.

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?

A single front-loaded sentence with no filler; the verb and artifact come first. It is efficient but borders on under-specification for a filesystem-mutating tool.

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

Completeness2/5

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

Five parameters, mutation of a real project directory, and no output schema to explain results, yet the description says nothing about side effects (manifest edits, layout file creation, overwrite behavior) or what is returned. For a scaffolding tool whose whole value is knowing exactly what it writes, this leaves the agent guessing.

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 description coverage is 100% and includes defaults and an example for activityName and packageName, so the schema carries parameter meaning fully. The description contributes nothing about parameters, such as how activityName relates to the generated layout filename or what the module default implies, so baseline 3 applies.

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

Purpose4/5

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

States a specific verb ('Generate') and resource ('a new Activity Kotlin file') plus the target ('an existing Android project'), which lets an agent distinguish it from scaffold_fragment or scaffold_compose_screen by artifact type. Differentiation is implicit in the resource name only; the description never names a sibling.

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

Usage Guidelines2/5

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

There is no guidance on when to pick this over the sibling scaffolding tools (fragment, compose screen), nor any stated preconditions such as an already-initialized Gradle project. 'Add it to an existing Android project' hints at a prerequisite but does not spell one out.

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