export function createListWorkspacesTool(client) {
  return {
    name: "productier_list_workspaces",
    description: "List workspaces visible to the authenticated Productier user.",
    inputSchema: {
      type: "object",
      properties: {},
      additionalProperties: false
    },
    async invoke() {
      const response = await client.listWorkspaces();
      const workspaces = Array.isArray(response?.data) ? response.data : [];
      return {
        count: workspaces.length,
        workspaces
      };
    }
  };
}
