updateDeviceSwitchPort
Update configuration for a switch port on a Meraki device, including name, enabled state, PoE, VLAN, and voice VLAN.
Instructions
Update switch port configuration. For the full parameter set use call_meraki_api.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial | Yes | ||
| portId | Yes | ||
| name | No | ||
| enabled | No | ||
| poeEnabled | No | ||
| type | No | ||
| vlan | No | ||
| voiceVlan | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- meraki-mcp.py:516-521 (handler)Handler in meraki-mcp.py (non-dynamic): The actual MCP tool function named 'update_switch_port' which calls the Meraki SDK's dashboard.switch.updateDeviceSwitchPort() to update a switch port.
@mcp.tool() def update_switch_port(serial: str, port_id: str, name: str = None, tags: list[str] = None, enabled: bool = None, vlan: int = None) -> str: """Update a switch port""" kwargs = _build_kwargs(name=name, tags=tags, enabled=enabled, vlan=vlan) result = dashboard.switch.updateDeviceSwitchPort(serial, port_id, **kwargs) return json.dumps(result, indent=2) - meraki-mcp-dynamic.py:490-510 (handler)Handler in meraki-mcp-dynamic.py (dynamic/hybrid version): The MCP tool function named exactly 'updateDeviceSwitchPort' that accepts additional parameters (poeEnabled, type, voiceVlan) and delegates to the SDK via call_meraki_method.
@mcp.tool() async def updateDeviceSwitchPort( serial: str, portId: str, name: str = None, enabled: bool = None, poeEnabled: bool = None, type: str = None, vlan: int = None, voiceVlan: int = None, ) -> str: """Update switch port configuration. For the full parameter set use call_meraki_api.""" params = { "serial": serial, "portId": portId, **{k: v for k, v in dict( name=name, enabled=enabled, poeEnabled=poeEnabled, type=type, vlan=vlan, voiceVlan=voiceVlan ).items() if v is not None} } return await call_meraki_method("switch", "updateDeviceSwitchPort", **params) - meraki-mcp-dynamic.py:655-658 (registration)Registration reference: 'updateDeviceSwitchPort' is listed in the pre_registered_tools array in get_mcp_config() in the dynamic file.
"pre_registered_tools": ["getOrganizations", "getOrganizationAdmins", "getOrganizationNetworks", "getOrganizationDevices", "getNetwork", "getNetworkClients", "getNetworkEvents", "getNetworkDevices", "getDevice", "getNetworkWirelessSsids", "getDeviceSwitchPorts", "updateDeviceSwitchPort"], - meraki-mcp-dynamic.py:385-387 (helper)Helper function: call_meraki_method is the async wrapper used by the updateDeviceSwitchPort handler to dispatch the call to the Meraki SDK.
async def call_meraki_method(section: str, method: str, **params) -> str: """Internal async wrapper for pre-registered tools""" return await to_async(_call_meraki_method_internal)(section, method, params)