Skip to main content
Glama

List Bluetooth Devices

list_bluetooth_devices
Read-onlyIdempotent

Retrieve all paired Bluetooth devices and check their current connection status.

Instructions

List paired Bluetooth devices with their connection status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the list_bluetooth_devices tool by running a JXA script via runJxa.
    async () => {
      try {
        return ok(await runJxa(listBluetoothDevicesScript()));
      } catch (e) {
        return errJxaFor("list bluetooth devices", e);
      }
    },
  • Schema and metadata for the list_bluetooth_devices tool (no input parameters, read-only).
    {
      title: "List Bluetooth Devices",
      description: "List paired Bluetooth devices with their connection status.",
      inputSchema: {},
      annotations: {
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false,
      },
  • Registration of the list_bluetooth_devices tool on the MCP server via server.registerTool.
    server.registerTool(
      "list_bluetooth_devices",
      {
        title: "List Bluetooth Devices",
        description: "List paired Bluetooth devices with their connection status.",
        inputSchema: {},
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async () => {
        try {
          return ok(await runJxa(listBluetoothDevicesScript()));
        } catch (e) {
          return errJxaFor("list bluetooth devices", e);
        }
      },
    );
  • Helper function that returns a JXA script string which uses system_profiler to list Bluetooth devices with their connection status, address, and type.
    export function listBluetoothDevicesScript(): string {
      return `
        const app = Application.currentApplication();
        app.includeStandardAdditions = true;
        const output = app.doShellScript('system_profiler SPBluetoothDataType -json 2>/dev/null');
        const data = JSON.parse(output);
        const devices = [];
        const btData = data.SPBluetoothDataType || [];
        for (const section of btData) {
          const devicesMap = section.devices_list || section.device_connected || [];
          for (const entry of (Array.isArray(devicesMap) ? devicesMap : [devicesMap])) {
            if (typeof entry === 'object' && entry !== null) {
              for (const name of Object.keys(entry)) {
                const info = entry[name] || {};
                devices.push({
                  name: name,
                  connected: info.device_connected === 'device_connected_yes' || info.device_connected === 'attrib_Yes' || false,
                  address: info.device_address || null,
                  type: info.device_minorType || null
                });
              }
            }
          }
        }
        JSON.stringify({total: devices.length, devices: devices});
      `;
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. The description adds value by specifying that the output includes connection status, which is not evident from annotations alone.

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?

A single, front-loaded sentence that conveys all necessary information without any filler or redundant words.

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

Completeness5/5

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

Given no parameters and no output schema, the description provides sufficient detail about what the tool does (list paired devices with connection status). The tool is simple and the context is complete.

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?

The tool has no parameters, and schema coverage is 100%. The baseline for 0 parameters is 4, and the description does not need to add parameter info.

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?

The description clearly states the tool lists paired Bluetooth devices with their connection status. The verb 'list' and resource 'paired Bluetooth devices' are specific, and the tool is distinct from all sibling tools.

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

Usage Guidelines3/5

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

No explicit guidance on when to use vs alternatives is provided. However, since no sibling tool duplicates this functionality, the context implies it is the appropriate tool for listing Bluetooth devices.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/heznpc/AirMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server