Skip to main content
Glama
switch-parental-controls

switch-parental-controls

switch_set_day_restrictions

Idempotent

Set one weekday's playtime limit and bedtime to apply distinct rules for school days and weekends.

Instructions

Set the playtime limit and bedtime of one weekday.

Use it to give e.g. weekends other rules than school days. Each call sets both settings of that day: playtime_enabled with max_playtime_minutes, and bedtime_enabled with the alarm and end time. It only takes effect while the timer mode is EACH_DAY_OF_THE_WEEK (switch_set_timer_mode). For the same bedtime on every day use switch_set_bedtime_alarm and switch_set_bedtime_end_time. Returns a confirmation with the day's rules.

Invalid combinations, like playtime_enabled=true without max_playtime_minutes, are rejected with the reason. Returns "Error: Device '' not found. ..." for an unknown device_id. Returns "Error: Not authenticated. ..." without a session token and "Error: Authentication failed. ..." when it expired; then log in again with switch_get_login_url.

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": {
      "device_id": "<device_id>",
      "day_of_week": "<day_of_week>",
      "playtime_enabled": "<playtime_enabled>",
      "bedtime_enabled": "<bedtime_enabled>"
    },
    "name": "switch_set_day_restrictions"
  }
}

Input Schema

NameRequiredDescriptionDefault
device_idYesThe unique device ID. Use switch_list_devices to find it.
day_of_weekYesDay of the week to configure (e.g. 'MONDAY').
bedtime_enabledYesWhether to enable bedtime restrictions for this day.
bedtime_end_hourNoHour when bedtime ends / device can be used again (5-9). Required if bedtime_enabled is true.
playtime_enabledYesWhether to enable a playtime limit for this day.
bedtime_alarm_hourNoHour for the bedtime alarm (16-23). Required if bedtime_enabled is true.
bedtime_end_minuteNoMinute when bedtime ends (0-59).
bedtime_alarm_minuteNoMinute for the bedtime alarm (0-59).
max_playtime_minutesNoMaximum playtime in minutes for this day (0-360). Required if playtime_enabled is true.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv1.4.1
    • removedInput schema / $defs / SetDayRestrictionsInput
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "Input model for setting per-day-of-week restrictions.",
      -  "properties": {
      -    "bedtime_alarm_hour": {
      -      "anyOf": [
      -        {
      -          "maximum": 23,
      -          "minimum": 16,
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "description": "Hour for the bedtime alarm (16-23). Required if bedtime_enabled is true.",
      -      "title": "Bedtime Alarm Hour"
      -    },
      -    "bedtime_alarm_minute": {
      -      "anyOf": [
      -        {
      -          "maximum": 59,
      -          "minimum": 0,
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": 0,
      -      "description": "Minute for the bedtime alarm (0-59).",
      -      "title": "Bedtime Alarm Minute"
      -    },
      -    "bedtime_enabled": {
      -      "description": "Whether to enable bedtime restrictions for this day.",
      -      "title": "Bedtime Enabled",
      -      "type": "boolean"
      -    },
      -    "bedtime_end_hour": {
      -      "anyOf": [
      -        {
      -          "maximum": 9,
      -          "minimum": 5,
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "description": "Hour when bedtime ends / device can be used again (5-9). Required if bedtime_enabled is true.",
      -      "title": "Bedtime End Hour"
      -    },
      -    "bedtime_end_minute": {
      -      "anyOf": [
      -        {
      -          "maximum": 59,
      -          "minimum": 0,
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": 0,
      -      "description": "Minute when bedtime ends (0-59).",
      -      "title": "Bedtime End Minute"
      -    },
      -    "day_of_week": {
      -      "$ref": "#/$defs/DayOfWeek",
      -      "description": "Day of the week to configure (e.g. 'MONDAY')."
      -    },
      -    "device_id": {
      -      "description": "The unique device ID. Use switch_list_devices to find it.",
      -      "title": "Device Id",
      -      "type": "string"
      -    },
      -    "max_playtime_minutes": {
      -      "anyOf": [
      -        {
      -          "maximum": 360,
      -          "minimum": 0,
      -          "type": "integer"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ],
      -      "default": null,
      -      "description": "Maximum playtime in minutes for this day (0-360). Required if playtime_enabled is true.",
      -      "title": "Max Playtime Minutes"
      -    },
      -    "playtime_enabled": {
      -      "description": "Whether to enable a playtime limit for this day.",
      -      "title": "Playtime Enabled",
      -      "type": "boolean"
      -    }
      -  },
      -  "required": [
      -    "device_id",
      -    "day_of_week",
      -    "playtime_enabled",
      -    "bedtime_enabled"
      -  ],
      -  "title": "SetDayRestrictionsInput",
      -  "type": "object"
      -}
    • addedInput schema / properties / bedtime_alarm_hour
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 23,
      +      "minimum": 16,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Hour for the bedtime alarm (16-23). Required if bedtime_enabled is true.",
      +  "title": "Bedtime Alarm Hour"
      +}
    • addedInput schema / properties / bedtime_alarm_minute
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 59,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": 0,
      +  "description": "Minute for the bedtime alarm (0-59).",
      +  "title": "Bedtime Alarm Minute"
      +}
    • addedInput schema / properties / bedtime_enabled
      Added value: +{
      +  "description": "Whether to enable bedtime restrictions for this day.",
      +  "title": "Bedtime Enabled",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / bedtime_end_hour
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 9,
      +      "minimum": 5,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Hour when bedtime ends / device can be used again (5-9). Required if bedtime_enabled is true.",
      +  "title": "Bedtime End Hour"
      +}
    • addedInput schema / properties / bedtime_end_minute
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 59,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": 0,
      +  "description": "Minute when bedtime ends (0-59).",
      +  "title": "Bedtime End Minute"
      +}
    • addedInput schema / properties / day_of_week
      Added value: +{
      +  "$ref": "#/$defs/DayOfWeek",
      +  "description": "Day of the week to configure (e.g. 'MONDAY')."
      +}
    • addedInput schema / properties / device_id
      Added value: +{
      +  "description": "The unique device ID. Use switch_list_devices to find it.",
      +  "title": "Device Id",
      +  "type": "string"
      +}
    • addedInput schema / properties / max_playtime_minutes
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 360,
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Maximum playtime in minutes for this day (0-360). Required if playtime_enabled is true.",
      +  "title": "Max Playtime Minutes"
      +}
    • removedInput schema / properties / params
      Removed value: -{
      -  "$ref": "#/$defs/SetDayRestrictionsInput"
      -}
    • addedInput schema / properties / playtime_enabled
      Added value: +{
      +  "description": "Whether to enable a playtime limit for this day.",
      +  "title": "Playtime Enabled",
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "params"
      -]New value: +[
      +  "device_id",
      +  "day_of_week",
      +  "playtime_enabled",
      +  "bedtime_enabled"
      +]
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true, destructiveHint=false), it discloses the key write semantics: each call overwrites BOTH settings of that day in one shot, plus validation rejection, unknown-device errors, and expired-session handling with a pointer to switch_get_login_url. It stops short of saying what happens to previously configured day rules when the timer mode is not EACH_DAY_OF_THE_WEEK, which is the one remaining behavioral ambiguity.

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

Conciseness5/5

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

The core action and the settings pairing lead; conditional caveats, alternatives, and error behavior follow in short blocks. The enumerated error strings are slightly verbose but each one routes the agent to a concrete recovery action, so nothing is filler.

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 9-parameter mutation tool with an output schema, the definition covers preconditions, validation, and failure modes, which is close to complete. The main gap is what happens to stored per-day rules when the timer mode is not EACH_DAY_OF_THE_WEEK — ignored, rejected, or preserved?

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

Parameters5/5

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

Schema coverage is already 100%, but the description adds cross-parameter conditional semantics the schema only partly encodes: playtime_enabled pairs with max_playtime_minutes and bedtime_enabled pairs with the alarm and end time, and it gives the concrete invalid combination (playtime_enabled=true without max_playtime_minutes). That is real meaning beyond the field-level docs.

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?

"Set the playtime limit and bedtime of one weekday" gives a specific verb and a precisely scoped resource (one weekday). It explicitly distinguishes itself from switch_set_bedtime_alarm, switch_set_bedtime_end_time, and switch_set_daily_playtime_limit, so an agent can separate this per-day tool from the per-setting and per-day-limit siblings.

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

Usage Guidelines5/5

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

It names the use case (per-day rules, e.g. weekends vs. school days), the hard precondition (only effective while timer mode is EACH_DAY_OF_THE_WEEK, pointing to switch_set_timer_mode), and the explicit alternative for uniform bedtimes (switch_set_bedtime_alarm / switch_set_bedtime_end_time). That is when-to-use, when-not-to-use, and alternatives in one place.

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