Skip to main content
Glama

Session set defaults

session_set_defaults
Idempotent

Pin a default project_dir and/or device serial once per session so later Gradle or device calls can omit them; per-call values still override.

Instructions

Pin a default project_dir and/or serial for the rest of this session so later calls can omit them — the fix for a multi-module or multi-flavor project (or multiple attached devices) forcing you to repeat the same project_dir/serial on every Gradle or device call. Only the fields you pass are changed; omit a field to leave its current default alone. An explicit project_dir/serial on any individual call always overrides the session default for that one call.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "session_set_defaults"
  }
}

Input Schema

NameRequiredDescriptionDefault
serialNoDefault device serial to use whenever a tool call omits serial. Leave empty to leave the current default unchanged.
project_dirNoDefault Android project root to use whenever a tool call omits project_dir. Leave empty to leave the current default unchanged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare idempotent, non-destructive, closed-world behavior, and the description adds the two facts that matter most: partial-update semantics ('Only the fields you pass are changed; omit a field to leave its current default alone') and precedence ('An explicit project_dir/serial on any individual call always overrides the session default'). It stops short of saying whether values are validated (e.g., an unknown serial) or how defaults are removed.

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?

Front-loaded with the action and the payoff, then the two rules that govern behavior. It is dense but every clause carries information; the only cost is a single long opening sentence that would read better split.

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

Completeness4/5

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

For a two-optional-parameter session setter with full schema coverage and annotations, the description covers scope, merge behavior, and precedence. The one real gap is that it never points to session_clear_defaults for unsetting, and the schema's 'leave empty to leave unchanged' wording implies there is no in-tool way to remove a default.

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

Parameters4/5

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

Schema coverage is 100% and both parameters are already documented, so the baseline is 3. The description adds genuine meaning beyond the schema by spelling out override precedence for individual calls, which the schema never states, and by reinforcing the omit-means-unchanged rule.

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?

States a specific verb and object ('Pin a default project_dir and/or serial') plus its scope ('for the rest of this session') and its effect ('later calls can omit them'). The purpose is unmistakable and clearly distinct from sibling setters like stop_app or set_location.

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?

Gives a concrete triggering scenario ('multi-module or multi-flavor project, or multiple attached devices forcing you to repeat the same project_dir/serial on every Gradle or device call'), which is strong when-to-use guidance. It falls short of a 5 because the obvious companion tools session_clear_defaults and session_show_defaults are never named as alternatives for unsetting or inspecting the defaults.

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